| Contests - ACM Student Chapter - PSUT |
|---|
| Private |
| Spectator |
| JU Cup 2026 |
|---|
| Finished |
Laith was walking around the University of Jordan with Aziz, they were trying to have fun, so Aziz decided to give Laith a regular polygon with $$$N$$$ vertices (an $$$N$$$-gon) has $$$n$$$ equal sides and $$$N$$$ equal angles and give Laith a side length $$$S$$$.
After that, Aziz will ask Laith $$$Q$$$ questions, in each question Aziz will give Laith $$$3$$$ vertices of the $$$n$$$-gon, Laith needs to find the area of the resulted triangle when connecting the $$$3$$$ points.
The first line contains one integer $$$T$$$ ($$$1 \le T \le 10^4)$$$ –denotes the number of test cases.
The first line of each test case contains three integers $$$N$$$, $$$S$$$, and $$$Q$$$ ($$$3 \le N \le 10^9$$$, $$$1 \le S \le 1000$$$, $$$1 \le Q \le 2 \cdot 10^5$$$) — denotes the number of vertices in the polygon, the side length of the polygon, and the number of queries, respectively.
Each of the next $$$Q$$$ lines contains three integers $$$u$$$, $$$v$$$, and $$$w$$$ ($$$1 \le u, v, w \le N$$$) — denotes the indices of the vertices chosen for the query.
It is guaranteed that $$$u, v$$$, and $$$w$$$ are distinct.
For each query, output the area of the triangle formed by the vertices $$$u, v$$$, and $$$w$$$.
Your answer will be considered correct if its absolute or relative error does not exceed $$$10^{-9}$$$. Formally, let your answer be $$$a$$$, and the jury's answer be $$$b$$$. Your answer is accepted if and only if $$$\frac{\vert{}a - b\vert{}}{\max(1, \vert{}b\vert{})} \le 10^{-9}$$$.
23 1 11 2 36 5 21 3 51 2 4
0.433012702 32.475952642 21.650635095
| Name |
|---|

