#BS0000411. Sợ bóng tối (Fear of the Dark)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Sợ bóng tối (Fear of the Dark)
Fear of the Dark
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Monocarp starts at and wants to reach home at using only illuminated locations. Lamps at and are assigned the same real power . Each illuminates the closed disk of radius centered at its location. The lamps do not obstruct movement. Find the smallest for which a continuous, entirely illuminated route joins to .
Input
Line 1 contains integers . Line 2 contains . Line 3 contains .
Output
Print the minimum radius . The absolute or relative error must not exceed .
Subtasks
- Subtask 1 (20 points): ; are pairwise distinct. .
- Subtask 2 (30 points): ; are pairwise distinct.
- Subtask 3 (50 points): ; are pairwise distinct.
Examples
Input
3 3
1 0
-1 6
Output
3.6055512755
Explanation
Lamp A is 1 unit from and units from . At radius its disk contains the segment . A smaller radius leaves outside both disks, since B is 5 units from . The minimum is .
Input
3 3
-1 -1
4 3
Output
3.2015621187
Explanation
Lamp A is from ; B is one unit from . Their separation is , so at the disks touch. A path through that contact point connects the endpoints. A smaller radius leaves the disks disjoint, and neither lamp alone covers both endpoints since and .
