Circle of Polygon(Gym-102267H)

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,那么有:zeta=\frac{2\pi}{n}*\frac{1}{2}

由于:sin\:zeta=\frac{\frac{L}{2}}{R}

故:R=\frac{\frac{L}{2}}{sin\:zeta}

因此,结果为:R*R*\pi

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)

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值