A Snowball Problem


Submit solution

Points: 12
Time limit: 1.0s
Memory limit: 128M

Author:
Problem type

MstrPikachu is very unhappy that A Car Problem was moved from J1 to J2. In fact, he is so angry he decides roll a snowball from the top of a hill to Ninjaclasher's house! Can you help him find the time it takes for the snowball to hit Ninjaclasher's house?

Assume the mass \(M\) and radius \(R\) of the snowball does not change during its descent, and the snowball rolls without slipping. The snowball has an initial velocity of 0.

Assume the hill is an infinite plane at an angle of \(\theta\) radians. The snowball reaches the bottom of the hill when it has travelled \(h\) metres downwards.

Assume no energy is lost to air resistance or friction. All values are in SI units, and \(g = 9.81 m/s^2\).

Input Specification

The first line will contain the real numbers \(M\) \((0 < M \le 10^{18})\), \(R\) \((0 < R \le 10^{18})\).

The second line will contain the real numbers \(h\) \((0 \le h \le 10^{18})\), \(\theta\) \((0 < \theta \le \frac{\pi}{2})\).

\(\theta\) will have at most 12 decimal places, and all other values will have at most 4 decimal places.

Output Specification

The time it takes for the snowball to reach the bottom of the hill. Outputs with a relative or absolute error of \(10^{-6}\) will be accepted.

Sample Input

4.0 5.0
1.0 0.3

Sample Output

1.807828

Comments

There are no comments at the moment.