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, 2r units wide. Since Mr. A. G. Nostik knows little about Virgins, Saints and Angels, he is thinking about a geometric pattern: Let n be an even integer number, at least 4. Mr. Nostik plans to pick n points, each at distance r of the center of the window, these points being the vertices of a regular polygon. (The next page shows an example with n = 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 n = 8 there are four regions. We number these regions 1, 2, 3 and 4 starting to count from the center of the rose. In general, there are n/2 regions. A regular octagon inside a circle A rose window with 8 points First region of the rose above Second region of the rose above Third region of the rose above Fourth region of the rose above 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.

2/2 Input Input begins with one integer 0 ≤ m ≤ 100000; m lines follow, each with r (a real number between 1 and 100), n (an even integer number between 4 and 40), and k (1 ≤ k ≤ n/2). Output For every combination of r, n and k, print the area (in square units) of the k-th region of a rose window with n points and radius r, rounded to four decimal digits. Sample Input 4 50 8 3 9.238794 8 2 10 4 1 20 4 1 Sample Output 2928.9322 100.0000 200.0000 800.0000