joj 1173

1173: Circle More Alike


ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE
3s8192K661258Standard

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

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值