Under construction

Still being built. Things may change

Fence Bowling

Time limit1sMemory limit512 MB

Summary
Find the throw angle so the ball, starting centered and bouncing k times off the rails with a nonlinear reflection law, lands exactly centered at the lane's end.
Level

Medium7 of 10

Topics
Math, Geometry, Binary search, Implementation
Solved
No attempts yet

Problem

Olav is spending an evening on his own, practicing in the bowling hall. Annoyingly, the side-rails in his lane are stuck in the active position, so if the ball goes out of bounds, it simply bounces back in. This seems unfair to Olav, so he decides that any throw that does not bounce exactly k times off the fences before it hits the pins will be disqualified.

For this purpose, Olav has studied in detail how the ball bounces. His finding is that a ball hitting the fence with angle α relative to the normal will bounce back with degree

arctan(2 tan(α))

relative to the normal. See the example in the picture to the right.

With which angle β relative to the normal against the rails should Olav throw the ball to hit a strike after first bouncing k times? Note that to hit a strike, Olav must hit exactly the middle of the bowling lane when the ball reaches the end of the lane. He always begins the throw from the middle of the lane as well.

Input

The first and only line of input contains three positive integers k, w and ℓ. Here, k (1 ≤ k ≤ 10) is the number of bounces required, w (1 ≤ w ≤ 100) is the width of the bowling lane, and ℓ (1 ≤ ℓ ≤ 100) is the length of the bowling lane.

Output

A single real number, the angle β in degrees. Any answer within an absolute or relative error of 10−6 will be accepted as a correct answer.

Examples1

  1. Example 1

    Input
    2 8 27
    
    Expected output
    36.8698976