Hide

Problem A
Canopy Rotation

Alice is preparing for lunch at a picnic table. However, rain is in the forecast, so Alice wants to know what the probability that the picnic table remains entirely dry. The picnic table has a canopy tent that prevents the rain from getting anything directly underneath the tent wet. The canopy tent covers a rectangular $A \times B$ area, and the picnic table is a $C \times D$ rectangle that shares a centre with the canopy tent. The canopy tent can also be rotated relative to the centre of the picnic table to fit the picnic table underneath.

When Alice arrives at the park, the canopy will be rotated at some uniformly distributed random angle. The picnic table is entirely dry if every part of the table is covered by the tent. For example, if the picnic table is $1 \times 4$ and the canopy is $4 \times 1$, then the picnic table will be entirely dry if the canopy is rotated exactly $\frac{\pi }{2}$ or $\frac{3\pi }{2}$ radians. Since there are infinitely many angles, but only two dry ones, there is a 0% chance that the picnic table will be dry.

Alice wants to know the probability that the picnic table is dry.

Input

The input consist of a single line of input with four integers $A$, $B$, $C$, and $D$ ($1 \leq A,B,C,D \leq 1\, 000$), which are the dimensions of the canopy tent and the picnic table.

Output

Print a single number, the percentage probability that the picnic table is entirely dry. Answers within $10^{-2}$ absolute error will be accepted.

Sample Input 1 Sample Output 1
1 4 4 1
0.0
Sample Input 2 Sample Output 2
9 9 3 3
100.0
Sample Input 3 Sample Output 3
90 47 100 1
1.15449676743173
Sample Input 4 Sample Output 4
20 6 1 13
25.55550317878999

Please log in to submit a solution to this problem

Log in