#Lutece1055. In the circle
In the circle
Migrated from Lutece 1055 In the circle
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
There are a circle in a two-dimension plane and a point strictly in the circle. The point will move in a straight line, and reflect when it touches the circle. The initial position and initial direction are given.
Now Alice is wondering the area of the route when it forms a closed polygon in the first time.
As is known to everyone of you, Bob loves Alice very much. Could you tell Bob the answer to help Bob leave a good impression on Alice.
Input
The first line contains one single integer , indicating the number of test cases.
For each test case, the first line contains a real number , indicating the radius of the circle.
The following line contains two real numbers and , indicating the initial coordinates of the point.
The following line contains two real numbers and , indicating the initial direction of the point.
It is guaranteed that the point is strictly in the circle initially, and the route of the point will not pass the centre point. You can assume the centre point is .
Output
For each test case, print the answer in one line. The answer should be rounded to digits after the decimal point.
Samples
1
2.0
1.0 0.0
0.0 1.0
5.196
Resources
The 13th UESTC Programming Contest Final