1173: Circle More Alike
Result | TIME Limit | MEMORY Limit | Run Times | AC Times | JUDGE |
---|---|---|---|---|---|
3s | 8192K | 661 | 258 | Standard |
1st Jilin University ACM International Collegiate Programming Contest
In this problem, you are to write a program to calculate the roundness of a polygon. The roundness of a polygon is defined the quotient of its area and the square of its circumference. More specifically:
In order to calcuate the area of a polygon, you need another formula:
where (xi, yi) are the coordinates of the vertex i(in direction of clockwise) of the polygon and n is the number of vertices.
Input Specification
The input consists of M polygons. The first line of the input is an integer M. Then follow M polygons, each of which is described below:
n
x0 y0
x1 y1
...
xn-1 yn-1
where n(3<=n<=100) is the number of vertices of the polygon and (xi, yi) are integers. The coordinates of the vertices of each polygon are given in the sequence of clockwise.
Output Specification
For each polygon, you should print its roundness by the formula described above. Each polygon occupies a single line in the output. The roundness should be accurated to 0.001.
Sample Input
2 4 0 0 0 1 1 1 1 0 3 0 0 1 1 2 0
Sample Output
0.063 0.043
This problem is used for contest: 110
Submit / Problem List / Status / Discuss