Shitália
Time Limit: 20 SecMemory Limit: 256 MB
题目连接
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88994#problem/A
Description
After suddenly becoming a billionaire, Shi adopted YOLO as his motto and decided to buy a small european island, which he named Shitalia. Many people decided to move to Shitalia to run away from the economic crisis, and then created the Shitalian mafia, led by Dom Shi.
The Shitalian economy is based on smuggling spoiled cheese, but, as you can imagine, there aren't many people interested in spoiled cheese. Therefore, Shi decided to earn money with land rental.
Shitalia is a star-shaped island. Shi is very picky, so he chose a Shi-regular n-star. An n-star is Shi-regular if there are n outer points andn inner points alternated. The outer points must lay on a circle with radius R and the inner points must lay on a circle with radius r and all the points must be equally spaced.
Print the area of the Shitalia.
Input
The first line contains three integers 3 ≤ n ≤ 20, 1 ≤ R ≤ 106 and 1 ≤ r ≤ R, indicating the number of points of Shitalia, the radius of the outer circle and the radius of the inner circle.
Output
Print a single real number - the answer to the problem with absolute or relative error of at most 10 - 6.
Sample Input
3 2 1
Sample Output
5.1961524227
HINT
题意
给你一个等n角形,然后求面积
题解:
数学题,一眼题,求三角形面积就好了……
代码:
//qscqesze#include#include #include #include #include #include #include #include #include #include #include #include #include