B. Area of the Devil
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Given a circle with radius $$$r$$$, there are five points $$$A_i$$$ ($$$i=1,2,\ldots,5$$$) arranged counterclockwise on the circle, and connecting them in the order of $$$A_1-A_3-A_5-A_2-A_4-A_1$$$ forms a pentagram. We call the above connection order the pentagram order. By slightly adjusting the arrangement, a reversed pentagram, which is the symbol of the devil, can be obtained.

However, the devil thinks this pattern is too rigid. It believes that each vertex of this pentagram should be movable in order to summon the devil. Therefore, the devil will let $$$A_i$$$ move on the circumference of a certain circle. Formally, consider the following five sets of points:

$$$$$$S_i=\{(x,y)\mid x=r \cos\theta,y=r \sin\theta,\theta_{s_i}\le \theta\le \theta_{t_i})\},i=1,2,\ldots,5$$$$$$

where $$$\theta_{s_i}$$$, $$$\theta_{t_i}$$$ are the left and right endpoints of the range of polar angles in which the point $$$A_i$$$ can move. Selecting $$$A_i$$$ from $$$S_i$$$ (it's guaranteed that there is no intersection between $$$S_i$$$ and they are arranged counterclockwise), and connecting them in the pentagram order forms a pentagram. For a point $$$P$$$ on the two-dimensional plane, if there exists a point $$$A_i$$$ in $$$S_i$$$, and $$$P$$$ is inside the pentagram formed by these five points, it is called a devil seal point. What is the area of the set of points formed by all devil seal points? The pentagram formed by the five points refers to the pentagram formed by connecting them in the pentagram order.

The devil has $$$T$$$ such questions to ask you. If you cannot answer quickly, it will curse you to draw the devil card the next time you draw a tarot card.

Input

The first line contains an integer $$$T$$$ ($$$1\le T \le 10^4$$$) representing the number of test cases.

Each test case consists of three lines. The first line contains an integer $$$r$$$ ($$$1\le r \le 10^3$$$), the second line contains five integers, where the $$$i$$$-th integer represents $$$\theta_{s_i}$$$ ($$$0\le \theta_{s_i}\le 359$$$), and the third line contains five integers, where the $$$i$$$-th integer represents $$$\theta_{t_i}$$$ ($$$0\le \theta_{t_i}\le 359$$$). The angles above are in degree form and represent the five sets of points mentioned in the problem.

It is guaranteed that there is no intersection between the sets of points, and they are arranged counterclockwise, i.e., $$$\theta_{s_i}\le\theta_{t_i}$$$ ($$$i=1,2,\ldots,5$$$), and $$$\theta_{t_i} \lt \theta_{s_{i+1}}$$$ ($$$i=1,2,\ldots,4$$$).

Output

For each test case, output a real number representing the area of all possible locations where the devil seal point $$$P$$$ may appear. Your answer will be considered correct only if the relative or absolute error between your answer and the correct answer does not exceed $$$10^{-6}$$$.

Example
Input
2
10
54 126 198 270 342
54 126 198 270 342
10
54 126 198 270 342
64 136 208 280 352
Output
112.256994145
168.007261527
Note

The first example gives the area of the inscribed regular pentagon with a radius of $$$10$$$. The image following shows a possible pentagram of the second example, where the five solid line arcs are the five sets of points for example two.

Please note that reading in a large number of floating-point numbers will cause an I/O slowdown.