Shitália
Time Limit: 20 Sec

Memory 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.

 Shi-regular 6-star and 4-star.

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 <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 200051
#define mod 10007
#define eps 1e-9
int Num;
//const int inf=0x7fffffff; //нчоч╢С
const int inf=0x3f3f3f3f;
inline ll read()
{
ll x=,f=;char ch=getchar();
while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
//**************************************************************************************
#define pi 3.1415926535898 int main()
{
double n,R,r;
cin>>n>>R>>r;
printf("%.10lf\n",sin(pi/n)*r*R*n);
}

最新文章

  1. 根据url下载图片
  2. get_headers()函数
  3. 关于div弹出层的实际应用心得
  4. 有向图的强连通分量——Tarjan
  5. 原生js 实现购物车价格和总价 统计
  6. Leetcode#135 Candy
  7. iOS使用Charts框架绘制—柱形图
  8. sharepoint的webpart开发
  9. Delphi 10.1说明
  10. Docker 跟 NodeJs 最佳实践
  11. Swift语言中与C/C++和Java不同的语法(三)
  12. 配置JAVA开发环境
  13. 学习erlang书籍 - 转
  14. 离线LCA学习
  15. 判断一个对象是否为真 __nonzero__ 方法和 __len__方法
  16. [翻译] 学习iOS开发的建议:如何从菜鸟到专家
  17. 解决wordpress无法发送邮件的问题|配置好WP-Mail-SMTP的前提
  18. 在JS中,一切东东其实都是对象
  19. uvalive 6932
  20. 前端面试题 ---- html篇

热门文章

  1. 【CSS】使用CSS改变超链接样式
  2. CSS HACK区别IE6、IE7、IE8、Firefox兼容性
  3. POJ 1860 Currency Exchange
  4. android 触摸事件、点击事件的区别
  5. 改变DEV控件的字体 z
  6. 使用PHP绘制统计图
  7. 叉积判断 POJ1696
  8. [Java基础]Java通配符
  9. Codeforces 375
  10. QTREE系列题解