#13235. [NEERC 2015] Froggy Ford(征集SPJ)

    ID: 13235 传统题 1000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>P6978贪心2015二分Special Judge最短路生成树ICPCNERC/NEERC

[NEERC 2015] Froggy Ford(征集SPJ)

[NEERC 2015] Froggy Ford(征集SPJ)

题目描述

Fiona designs a new computer game Froggy Ford. In this game, a player helps a frog to cross a river using stone fords. Frog leaps from the river's shore to the first stone ford, than to the second one and so on, until it reaches the other shore. Unfortunately, frog is pretty weak and its leap distance is quite limited. Thus, a player should choose the optimal route -- the route that minimizes the largest leap required to traverse the route.

Optimal route

Optimal route with added stone

Fiona thinks that this game is not challenging enough, so she plans to add a possibility to place a new stone in the river. She asks you to write a program that determines such a location of the new stone that minimizes the largest leap required to traverse the optimal route.

输入格式

The first line of the input file contains two integers $w$ -- the width of the river and $n$ -- the number of stones in it $(1 \le w \le 10^{9}, 0 \le n \le 1000)$ .

Each of the following nn lines contains two integers xi,yix_{i}, y_{i} -- the coordinates of the stones (0<xi<w,−109≤yi≤109).(0 < x_{i} < w , −10^{9} \le y_i \le 10^{9}). Coordinates of all stones are distinct. River shores have coordinates x=0x = 0 and x=wx = w .

输出格式

Write to the output file two real numbers $x_{+}$ and $y_{+} (0 < x_{+}
10 7
2 2
2 4
5 1
5 3
8 2
7 5
9 4
4.5 4.5

提示

Time limit: 1 s, Memory limit: 256 MB. 标签: P6978|贪心|2015|二分|Special Judge|最短路|生成树|ICPC|NERC/NEERC

来源

P6978|[NEERC 2015] Froggy Ford(征集SPJ)