Under construction

Still being built. Things may change

Rains

Time limit2sMemory limit512 MB

Summary
Given a grid of regular N-gons with side S and a brain of radius R, find the probability a random brain center lands close enough to a thread to be cut.
Level

Medium6 of 10

Topics
Geometry, Probability, Math, Implementation
Solved
No attempts yet

Problem

It is the end of the world. The fish community rises up against years of humanity's abuse and declares war on mankind.

After millions of years of unemployment and reliance on robots, humans became spheres of radius RR consisting of only one part, the brain. Fish rebels developed a special weapon named the rains of Atlantic, which consists of large heavy sieves prepared to slice humans. A sieve is made of extremely thin stretched strings in the form of a grid of convex regular NN-sided polygons of side length SS. The figure below shows examples for N=3N = 3, N=4N = 4, and N=6N = 6:

You are the last survivor, but they have finally identified the city where you hide. They are going to throw a sieve that will cover the whole city. Your brain will be sliced if one of the threads from the sieve touches it. What is the probability that your brain will be sliced if you can be located anywhere in the city with equal probability?

Input

Your program will be tested on one or more test cases. The first line of the input contains a single integer TT (1≤T≤1001 \le T \le 100), the number of test cases.

Each test case consists of one line containing three integers:

  • NN: the number of sides of the polygon in the sieve (3≤N≤1003 \le N \le 100)
  • SS: the side length of the polygon in the sieve (1≤S≤1,000,0001 \le S \le 1,000,000)
  • RR: the radius of your brain (1≤R≤1,000,0001 \le R \le 1,000,000)

Output

For each test case, print a single line containing the probability that your brain will be sliced, rounded to four decimal places.

Hint

A regular polygon is a polygon that is equiangular (all angles are equal in measure) and equilateral (all sides have the same length).

Examples1

  1. Example 1

    Input
    2
    82 875072 117331
    50 475634 389028
    
    Expected output
    0.0205
    0.1952