Rose windows P91283


Statement
 

pdf   zip

html

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 (with arbitrary colors) as shown in the example. 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.

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 t. Follow t cases, each with a real number r, an even integer number n, and an integer number k. Assume 1 ≤ r ≤ 100, 4 ≤ n ≤ 40, and 1 ≤ kn/2.

Output

For every case, print the area of the k-th region of a rose window with n points and radius r, 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++
    Event
    Segon Concurs de Programació de la UPC - Final
    Date
    2004-09-29