Michael is feeling cooped up in the middle of quarantine and wants to go outside for a bit of exercise; he misses the good old grade school days when he played tag daily with his friends. However, he can't play tag with other people right now, for fear of infection, so he must find other playmates. And who better to chase around than playful little squirrels? There are
We consider Michael to have caught a squirrel if they occupy the same
For this problem, Python users are recommended to use PyPy over CPython.
Constraints
For this problem, you will NOT be required to pass all the samples to receive points, and you are NOT required to pass all previous subtasks to receive points for a specific subtask.
For all subtasks:
It is guaranteed that Michael moves strictly faster than all of the squirrels (so a solution always exists).
Subtask 1 [24%]
Subtask 2 [26%]
Subtask 3 [50%]
No additional constraints.
Input Specification
On the first line will be two integers
The next
Output Specification
This problem is graded with a custom checker.
Output a single decimal number, the minimum time it will take for Michael to catch all of the squirrels. It is guaranteed that in the given test cases the answer will have value less than
Your answer will be considered correct if it has an absolute or relative error of at most
Sample Input 1
1 2
1 1 1 1
Sample Output 1
2.41421356237
Sample Explanation 1
Michael runs with all his might with velocity
Sample Input 2
2 4
8 0 -2 0
-10 0 -2 0
Sample Output 2
8
Sample Explanation 2
Michael and squirrel two run to
Sample Input 3
5 15
10 15 1 10
-10 -2 -6 -10
5 -19 -10 -5
-5 5 -1 -3
5 2 3 0
Sample Output 3
24.3674505759
Sample Explanation 3
Michael catches the squirrels in the order
Comments