UVa 10432 - Polygon Inside A Circle

10432 - Polygon Inside A Circle

 * http://acm.uva.es/p/v104/10432.html

Summary
Calculate the area of a polygon having equal sides inside a circle.

Explanation
The length of each side of the polygon are same. So if we add the n corners of the polygon to the center of the circle, then we get n triangles all having same area. Now the angle created at center by any triangle is exactly (2*pi / n) and the length of both arms of triangle is r. So the area of any triangle is A = 0.5 * r * r * sin (2*pi / n). So, area of polygon is n * A.

Gotchas
There are no special tricks in this problem.

Implementations
Notes/Hints on actual implementation here.

Optimizations
Optimizations here.

Input
Input Here

Output
Output Here