Problem Description
A circumscribed circlecircumscribed circle of a polygon is the circle that passes through all the vertices of that polygon.
Let's assume we have a regularregular polygon, we want to find the area of the circumscribed circle around this polygon. Given the number of vertices and the side length of the polygon, can you find the circle's area?
Input
The only line contains 2 integers , V(3≤V≤359) the number of vertices of the polygon and S(1≤S≤109)
Output
Find the area of the resulting circumscribed circle.Your answer will be considered correct if its absolute or relative error does not exceed 10−6.
Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct, if |a−b|max(1,b)≤10−6.
Examples
Input
8 2
Output
21.452136491
Note
The octagon in the picture illustrates the first example.
题意:给出一个具有 n 个点的正多边形,每条边长为 l,问最大外接圆面积
思路:
从圆心向任意一条边做垂线,再将圆心与做垂线的边连接上的点连接,那么,两条线构成一个三角形,角度为 zeta,一条线长为 R,一条边长为 l/2,那么有:
由于:
故:
因此,结果为:
Source Program
import math
n,l=map(float,input().split())
zeta=2*math.pi/n/2
R=(l/2)/math.sin(zeta)
print(R*R*math.pi)