Category

Similar Problems

0740. Ball in a Dream

Time limit : 1000 ms
Memory limit : 64 mb

A little boy likes throwing balls in his dreams. He stands on the endless horizontal plane and throws a ball at an angle of a degrees to the plane. The starting speed of the ball is V m/s. The ball flies some distance, falls down, then jumps off, flies again, falls again, and so on.

As far as everything may happen in a dream, the laws of the ball's motion differ from the usual laws of physics:

  • the ball moves in the gravity field with acceleration of gravity equal to 10 m/s2;
  • the rebound angle equals the angle of fall;
  • after every fall, the kinetic energy of the ball decreases by a factor of K;
  • there is no air in the dream;
  • "Pi" equals to 3.1415926535.

Your task is to determine the maximal distance from the point of throwing that the ball can fly

Input

The input contains three numbers: 0 ≤ V ≤ 5000, 0 ≤ a ≤ 90, and K > 1 separated by spaces. The numbers V and a are integers; the number K is real.

Output

   The output should contain the required distance in meters rounded to two fractional digits.

Samples

Input

Output

1

5 15 2.50

2.08

 

Tayyorladi: Azat Yusupov
Text from: acm.timus.ru