Pku1379 Run Away

时间限制:1s      空间限制:259MB

题目描述

One of the traps we will encounter in the Pyramid is located in the Large Room. A lot of small holes are drilled into the floor. They look completely harmless at the first sight. But when activated, they start to throw out very hot java, uh ... pardon, lava. Unfortunately, all known paths to the Center Room (where the Sarcophagus is) contain a trigger that activates the trap. The ACM were not able to avoid that. But they have carefully monitored the positions of all the holes. So it is important to find the place in the Large Room that has the maximal distance from all the holes. This place is the safest in the entire room and the archaeologist has to hide there.


输入格式

The input consists of T test cases. The number of them (T) is given on the first line of the input file. Each test case begins with a line containing three integers X, Y, M separated by space. The numbers satisfy conditions: 1 <= 0="" 1="" x,y="" <="10000," the="" numbers="" x="" and="" yindicate="" dimensions="" of="" large="" room="" which="" has="" a="" rectangular="" shape.="" number="" m="" stands="" for="" holes.="" then="" exactly="" lines="" follow,="" each="" containing="" two="" integer="" ui="" vi="" (0="" indicating="" coordinates="" one="" hole.="" there="" may="" be="" several="" holes="" at="" same="" position.="" p="">


输出格式

Print exactly one line for each test case. The line should contain the sentence "The safest point is (P, Q)." where P and Qare the coordinates of the point in the room that has the maximum distance from the nearest hole, rounded to the nearest number with exactly one digit after the decimal point (0.05 rounds up to 0.1).


样例输入

3
1000 50 1
10 10
100 100 4
10 10
10 90
90 10
90 90
3000 3000 4
1200 85
63 2500
2700 2650 
2990 100

样例输出

The safest point is (1000.0, 50.0).
The safest point is (50.0, 50.0).
The safest point is (1433.0, 1669.8).

提示

没有写明提示


题目来源

Cerc1999

Menuappsclose