eolymp
bolt
Try our new interface for solving problems
Problems

Rose windows

Rose windows

Mr. Arnold Gerald Nostik is in charge of the design of the main rose window of the new cathedral in his town. The rose window is circular, \textbf{2r} units wide. Since Mr. A. G. Nostik knows little about Virgins, Saints and Angels, he is thinking about a geometric pattern: Let \textbf{n} be an even integer number, at least \textbf{4}. Mr. Nostik plans to pick \textbf{n} points, each at distance\textbf{ r} of the center of the window, these points being the vertices of a regular polygon. (The next page shows an example with \textbf{n} = \textbf{8}.) These points are to be joined with straight lines, and the resulting regions colored as shown in the example. (The colors of the example are arbitrary.) Note that for \textbf{n} = \textbf{8} there are four regions. We number these regions \textbf{1}, \textbf{2}, \textbf{3} and \textbf{4} starting to count from the center of the rose. In general, there are \textbf{n}/\textbf{2} regions. Write a program to help Mr. Nostik to know how much glass of every color he needs in order to build a given rose window. \InputFile The first line contains number of test cases \textbf{t.} \textbf{t} lines follow, each with a real number \textbf{r} (\textbf{1} ≤ \textbf{r} ≤ \textbf{100}), an even integer \textbf{n} (\textbf{4} ≤ \textbf{n} ≤ \textbf{40}), and \textbf{k} (\textbf{1} ≤ \textbf{k} ≤ \textbf{n} / \textbf{2}). \OutputFile For every combination of \textbf{r}, \textbf{n} and \textbf{k}, print the area (in square units) of the \textbf{k}-th region of a rose window, rounded to four decimal digits. \includegraphics{https://static.e-olymp.com/content/b5/b5ca4332292feed4fd2dc7dcf29bbbff58a84618.jpg} \includegraphics{https://static.e-olymp.com/content/ec/ecbbc755403cd20e86d9bd9a1c6a3fddda427397.jpg} \includegraphics{https://static.e-olymp.com/content/2f/2fb33d6e14d7b488df93468200da2f9ddafe6ad5.jpg}
Time limit 1 second
Memory limit 64 MiB
Input example #1
4
50 8 3
9.238794 8 2
10 4 1
20 4 1
Output example #1
2928.9322
100.0000
200.0000
800.0000