CF630P.Area of a Star
提高+/省选-
通过率:0%
时间限制:0.50s
内存限制:64MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
It was decided in IT City to distinguish successes of local IT companies by awards in the form of stars covered with gold from one side. To order the stars it is necessary to estimate order cost that depends on the area of gold-plating. Write a program that can calculate the area of a star.
A "star" figure having n ≥ 5 corners where n is a prime number is constructed the following way. On the circle of radius r n points are selected so that the distances between the adjacent ones are equal. Then every point is connected by a segment with two maximally distant points. All areas bounded by the segments parts are the figure parts.

IT 城决定以单面镀金的星形奖章来表彰本地 IT 公司所取得的成就。为订购这些星形奖章,需估算订单成本,而该成本取决于镀金面积。请编写一个程序,用于计算该星形图形的面积。
一个具有 n(n≥5) 个顶点的“星形”图形(其中 n 为质数)按如下方式构造:在半径为 r 的圆周上选取 n 个点,使得相邻两点之间的弧长(或弦长)相等;然后将每个点分别与距离它最远的两个点用线段连接。所有由这些线段围成的区域即构成该图形的组成部分。

输入格式
The only line of the input contains two integers n (5 ≤ n < 109, n is prime) and r (1 ≤ r ≤ 109) — the number of the star corners and the radius of the circumcircle correspondingly.
输入仅包含一行,其中有两个整数 n(5≤n<109,且 n 为质数)和 r(1≤r≤109)——分别表示星形的顶点数和其外接圆的半径。
输出格式
Output one number — the star area. The relative error of your answer should not be greater than 10 - 7.
输出一个数字——星形的面积。你的答案的相对误差不应大于 10−7。
输入输出样例
输入#1
7 10
输出#1
108.395919545675
输入解题思路,AI测评打分。不知道怎么写?