编程介的小学生 2017-08-26 13:18 采纳率: 20.5%
浏览 654
已采纳

Groundhog Build Home

Problem Description
Groundhogs are good at digging holes, their home is a hole, usually a group of groundhogs will find a more suitable area for their activities and build their home at this area .xiaomi has grown up, can no longer live with its parents.so it needs to build its own home.xiaomi like to visit other family so much, at each visit it always start from the point of his own home.Xiaomi will visit all of the groundhogs' home in this area(it will chose the linear distance between two homes).To save energy,xiaomi would like you to help it find where its home built,so that the longest distance between xiaomi's home and the other groundhog's home is minimum.

Input
The input consists of many test cases,ending of eof.Each test case begins with a line containing three integers X, Y, N separated by space.The numbers satisfy conditions: 1 <= X,Y <=10000, 1 <= N<= 1000. Groundhogs acivity at a rectangular area ,and X, Y is the two side of this rectangle, The number N stands for the number of holes.Then exactly N lines follow, each containing two integer numbers xi and yi (0 <= xi <= X, 0 <= yi <= Y) indicating the coordinates of one home.

Output
Print exactly two lines for each test case.The first line is the coordinate of xiaomi's home which we help to find. The second line is he longest distance between xiaomi's home and the other groundhog's home.The output round to the nearest number with exactly one digit after the decimal point (0.05 rounds up to 0.1).

Sample Input
1000 50 1
10 10
1000 50 4
0 0
1 0
0 1
1 1

Sample Output
(10.0,10.0).
0.0
(0.5,0.5).
0.7

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-09-10 00:44
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何将下列的“无限压缩存储器”设计出来
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭