has been cornered!
With his Art Academy in ashes, his artworks missing, his friends all having left him, and his entire life in shambles, he has constructed a massive army with all of his forces in a last stand. The structure of his army is composed of
Knowing this information,
has ordered her subject, , to destroy the bunker and end the terror, once and for all. Since calculating curved trajectory is hard, he will send his missiles only in straight lines, starting from the x-axis, firing directly towards the bunker. However, being a merciful person, he will try to avoid hitting 's army at all costs, as they are not all as evil as him.Weighing his options,
would like to ask you a question:What is the total length of the range that
can fire from in order to hit 's bunker without hitting his army, if he can only fire starting from the x-axis, in the range, where the bunker is at ?
It is guaranteed that the y-position of his bunker will be strictly greater than the entirety of his army. In other words, his army will always be between the x-axis and his bunker.
Input Specification
On the first line, there is a single integer
The second line will contain four space-separated integers,
The next
Output Specification
Output the total length of the range which
can fire from in order to hit 's bunker without hitting his army.Your answer will be considered correct if the absolute difference from the official answer is at most
Constraints
Subtask 1 [30%]
Subtask 2 [70%]
No additional constraints.
Sample Input
1
1 10 3 3
1 2 3 1
Sample Output
7.000
Explanation
The green region represents the area which can be fired from. However, since you can only fire from the x-axis, in the range
Comments