| The 2026 ICPC Belarus Regional Contest |
|---|
| Закончено |
Have you ever been to a boring lesson with absolutely nothing to do? Everyone deals with it differently: some students prefer to train their art skills, some try to compensate for the lack of sleep, and Lucas is the only one in this class who does robotics instead.
Lucas has just programmed a robot. It draws a polyline on the 2D plane using a simple algorithm. Initially, the pencil controlled by the robot is located at the point $$$(0, 0)$$$ and faces right along the vector $$$(1, 0)$$$. Then, the following pair of actions is repeatedly performed:
If the pencil returns to $$$(0, 0)$$$ for the first time, and the resulting polyline does not intersect itself, the robot stops, and Lucas calls it a successful operation. In that case, Lucas wonders what the area of the figure bounded by the drawn polyline is.
We say that the polyline intersects itself if two of its segments have a common point other than a shared vertex of adjacent segments. Segments are adjacent if they are consecutive while drawing, and the first and the last segments are also adjacent if the polyline has returned to $$$(0, 0)$$$ for the first time.
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$): the number of test cases. Then, $$$t$$$ test cases follow.
The only line of a test case contains two integers $$$\alpha$$$ and $$$\beta$$$ ($$$1 \leq \alpha, \beta \leq 179$$$).
For each test case, print the area of the figure on a separate line if the robot succeeds, or $$$-1$$$ otherwise. If the printed value is not $$$-1$$$, the absolute or relative error must not exceed $$$10^{-6}$$$.
390 45150 6090 36
13.65685424951.2679491924-1
The figures below correspond to the example test cases (with possibly different scales of figures).
In the third test case of the example, the polyline intersects itself, and the figure is drawn only up to the first intersection.
| Название |
|---|


