Rectangle and the beam
Very hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Rectangle with sides parallel to coordinate axes, given the coordinates of two opposite vertices (x1, y1) and (x2, y2). Ray from the origin, given the angle α, which he makes with the positive direction of the x-axis.
Required to calculate the area of the rectangle that lies inside the angle formed by the ray and the positive direction of the y-axis.
Input
The input file contains the real numbers x1 y1 x2 y2 α. The angle is measured counter-clockwise and is measured in degrees.
All the coordinates do not exceed . Angle in the range from 0 to 360°.
Output
The output file should contain a single real number - the desired area. Reply to withdraw to within 1 digit after the decimal point.
Examples
Input #1
Answer #1
Submissions 160
Acceptance rate 4%