ZOJ Problem Set - 2503
Maybe you have ever heard that there is a small country named Schulland. Schulland is very interesting because it looks like a regular n-polygon. At each vertex there is a small house in which there lives a small and fat dwarf.
Once upon a time the King of Dwarfs decided to hold a small party at the same center of that n-polygon. Your task is just to determine how many units of time it takes a fat dwarf to reach the destination from his house. Unfortunately those dwarfs don't use the shortest path. All the time each of them goes in the direction of the dwarf that lives in the next house (counter-clockwise).
If we have 4-gon (a square)
Every dwarf has to go a way like this:
Your task is to calculate the length of that path.
In the first line there is an integer C (0<=C<=10 000), indicating the number of test cases.
In the next C lines there is an integer N (1<N<1 000 000 000), which means the number of vertices of the given N-polygon.
For each case, you should output your answer in a single line, rounded up to 3 digits after the decimal point.
Problemsetter: Mirek "Miras" Michalski (email@example.com)