#P10936. 导弹防御塔
导弹防御塔
Problem Description
Freda's castle is attacked by invaders.
Freda controls missile defense towers. Each tower has enough missiles, but it can fire only one missile at a time.
When firing a missile, it takes seconds for the missile to be launched from the tower. After firing, the tower that launched the missile needs minutes to cool down.
All missiles fly at the same constant speed , and they will travel along the shortest path to hit the target.
When computing the distance from a defense tower to a target, you only need to consider the horizontal distance and ignore the missile's flying height.
The missile's flying time in the air is minutes. After the missile arrives at the target, it can destroy it immediately.
Now you are given the coordinates of the missile defense towers, the coordinates of the invaders, and , and .
Since Freda's friend Rainbow is about to visit the castle, you need to find the minimum number of minutes required to repel all invaders.
Input Format
The first line contains five positive integers .
The next lines each contain two integers, representing the coordinates of an invader.
The next lines each contain two integers, representing the coordinates of a defense tower.
Output Format
Output a real number, meaning the minimum number of minutes needed to hit all invaders, rounded to six decimal places. An answer is considered correct if its difference from the standard answer does not exceed .
3 3 30 20 1
0 0
0 50
50 0
50 50
0 1000
1000 0
91.500000
Hint
Constraints: , the absolute value of each coordinate does not exceed , and are positive integers not exceeding .
Translated by ChatGPT 5