Lightning Strike

For each test case, compute the area of a circle cut by an infinite wedge with a given apex, direction, and spread angle.

Medium6GeometryMathImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

Decades ago the King of Nlogônia built a huge protective wall around the whole kingdom, and its people have lived in safety ever since. The wall is imposing and heavily reinforced, and it has the shape of a circle that encloses all of the King's lands.

For the past few weeks, however, the people of Nlogônia have been uneasy. Rumor has it that scientists of Quadradônia, a barbarian people living next to Nlogônia, have developed a deadly weapon that turns everything in its sights to dust.

The new weapon is a cannon that fires a proton beam. The beam starts at the cannon's muzzle and spreads out with a spread angle TT. The firing direction is given by an angle AA, measured counterclockwise from the xx axis. In other words, the beam covers an infinite wedge whose apex is the muzzle and which opens by T/2T/2 on each side of direction AA. The figure below shows (a) an example attack, (b) what would remain of Nlogônia, and (c) the area that would be destroyed.

Given the coordinates of the cannon, the firing direction, the spread angle of the proton beam, and the center and radius of the protective wall, write a program that computes the area of Nlogônia that will be destroyed.

Input

The input contains several test cases. Each test case consists of two lines.

The first line contains three integers XX, YY, RR. (X,Y)(X, Y) are the coordinates of the center of the wall's circle (0X10000 \le X \le 1000, 0Y10000 \le Y \le 1000), and RR is its radius (1R1001 \le R \le 100).

The second line contains four integers PP, QQ, AA, TT. (P,Q)(P, Q) is the location of the cannon (0P10000 \le P \le 1000, 0Q10000 \le Q \le 1000), AA is the firing direction in degrees (0A3590 \le A \le 359), and TT is the spread angle, also in degrees (1T1791 \le T \le 179). The angle AA is measured counterclockwise from the xx axis. The cannon is always outside Nlogônia, that is, the distance between (X,Y)(X, Y) and (P,Q)(P, Q) is greater than RR.

A line on which XX, YY, and RR are all 0 marks the end of the input. Do not process that line.

Output

For each test case, print one line with the area of Nlogônia that the attack would destroy, rounded to one decimal place. If no area is destroyed, print 0.0.