NECSTASY  Ecstasy
Swapnil loves to ride swings at the local park, he feels ecstatic on riding one! However, the park plot is recently being used up for the construction of a public building. Swapnil had been depressed, until his mother decided to put up a swing right beside their home!
Swapnil’s mom Swagata is now faced with a new problem. She has decided on the position of the swing in her yard, but height of the swing needs critical calculation.
Swagata has picked point A (directly downward from the hanging point) in her yard such that A has a perpendicular distance of d meters from the foot of their house. His feet need clearance of x meters above the ground, and y meters away from the building. Swapnil can keep balance while riding the swing if the swinging angle does not exceed thetadegrees. Your task is to calculate the maximum height h of Swapnil’s swing.
Input
Input file contains multiple test cases. Each test case begins with a line containing three positive floatingpoint numbers d, x and y (0<x,y<d<100) in meters. Next line of test case contains another floating point number, which is the maximum swinging angle theta in degrees (0<theta<180). It is guaranteed that all test cases will have a valid answer.
Output
For each sample input, output the maximum height h of the swing in meters with exactly two digits after decimal point.
Example
Input: 30.0 2.0 3.0 60.0 56.32 1.1 2.3 65.1 Output: 56.00 101.50
hide comments
horcrux2301:
20170125 09:36:45
@shadowfax What is the use of EOF ? 

Bhumit:
20160906 12:22:35
getting WA in Java


Shubhransh Srivastav:
20151221 13:20:52
For those who are getting wa use acos(1) in place of pi 

shadowfax:
20151206 21:11:59
There are less than 1000 test cases. Input ends with EOF. 

shadowfax:
20151206 21:09:46
You should round the answer to tow digits after decimal point. 

virdi_jasmin:
20151129 19:20:00
Last edit: 20151129 19:25:49 

vicky:
20151128 16:29:20
please anyone tell me that how many testcase i have to take 

Bhargav Golla:
20151125 23:43:08
Should we round the answer to two digits after decimal point or just print the number till two digits after decimal point? Could you also check what is wrong with my submission 15709141? 
Added by:  imranziad 
Date:  20151125 
Time limit:  0.5s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 GOSU JSMONKEY 
Resource:  AIUB CS Fest 2015 (Nuzhat Subrina) 