PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#FW0000047. Ếch qua hồ (Frogger)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Ếch qua hồ (Frogger)
Frogger
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
There are n stones at integer coordinates in a pond. A frog must travel from stone 1 to stone 2 and may land on intermediate stones. The difficulty of a route is its longest single jump. Minimize this maximum jump.
Input
First n, followed by n lines x_i y_i.
Output
Print the minimum possible maximum jump length with exactly three digits after the decimal point.
Subtasks
- Subtask 1 (40 points): . All coordinates are integers. Different stones may share the same coordinates.
- Subtask 2 (60 points): . All coordinates are integers. Different stones may share the same coordinates.
Examples
Input
3
0 0
6 0
3 0
Output
3.000
Explanation
The direct jump is 6 units. Using the third, middle stone gives two jumps of length 3, so the optimum is 3.000.