# UVa 10772

## Summary

A regular polygon with ${\displaystyle n}$ vertices (${\displaystyle n}$ is an even number) is inscribed in a circle of radius ${\displaystyle r}$. Then every two vertices of the polygon are joined with straight lines, and the resulting regions are colored in ${\displaystyle n/2}$ different colors as shown in figures.

 Error creating thumbnail: Unable to save thumbnail to destination Error creating thumbnail: Unable to save thumbnail to destination n=8 n=12

Determine the area of the ${\displaystyle k}$-th region. Regions are numbered from 1, starting from the innermost region.

## Explanation

If you study the figures carefully, you'll see that the boundary of every regions (except the outermost one) is a regular polygon with ${\displaystyle n}$ vertices, and its vertices are intersections of chords of the polygon.

More formally, let ${\displaystyle V_{i}}$ be the i-th vertex of the polygon: ${\displaystyle V_{i}=(r\cos {\frac {2\pi i}{n}},r\sin {\frac {2\pi i}{n}})}$. And let ${\displaystyle 1\leq k<{\frac {n}{2}}}$ be the number of region. Then the ${\displaystyle j}$-th vertex of the boundary of ${\displaystyle k}$-th region is the intersection of line segments ${\displaystyle V_{j}V_{j+(n/2)-k}}$ and ${\displaystyle V_{j+1}V_{j+1+(n/2)-k}}$.

The area of ${\displaystyle k}$-th region is the difference between inner areas of boundaries of ${\displaystyle k}$-th and ${\displaystyle k-1}$-st regions.

Area of regular polygon can be computed, if you know coordinates of its center O and one of vertices V. It equals ${\displaystyle {\frac {n}{2}}(OV)^{2}\sin {\frac {2\pi }{n}}}$

## Input

14
10 8 1
10 8 2
10 8 3
10 8 4
50 12 1
50 12 2
50 12 6
100 40 1
100 40 2
100 40 3
100 40 10
100 40 15
100 40 19
100 40 20


## Output

48.5281
117.1573
117.1573
31.3166
538.4758
1471.1432
353.9816
193.7897
576.5974
945.2074
2462.3319
1878.1616
576.5974
129.0335