Rose windows P91283


Statement
 

pdf   zip

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, 2r2r units wide. Since Mr. A. G. Nostik knows little about Virgins, Saints and Angels, he is thinking about a geometric pattern. Let nn be an even integer number, at least 4. Mr. Nostik plans to pick nn points, each at distance rr of the center of the window, these points being the vertices of a regular polygon. (The next page shows an example with n=8n = 8.) These points are to be joined with straight lines, and the resulting regions colored (with arbitrary colors) as shown in the example. Note that for n=8n = 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/2n/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.

Input

Input begins with a number tt. Follow tt cases, each with a real number rr, an even integer number nn, and an integer number kk. Assume 1r1001 \le r \le 100, 4n404 \le n \le 40, and 1kn/21 \le k \le n/2.

Output

For every case, print the area of the kk-th region of a rose window with nn points and radius rr, with four digits after the decimal point. The input cases have no precision issues.

Public test cases
  • Input

    4
    50 8 3
    9.238794 8 2
    10 4 1
    20 4 1
    

    Output

    2928.9322
    100.0000
    200.0000
    800.0000
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++