• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
HaibaraAi
博客园    首页    新随笔    联系   管理    订阅  订阅

TOJ Open Ural FU Championship 2013 D

D. Dummy Guy

Time limit: 0.5 second
Memory limit: 64 MB
Problem illustration
Every year students of our university participate in Regional Contest in Saint Petersburg. Train journeys from Yekaterinburg to Saint Petersburg make students very thirsty, so they usually take a lot of drinks with them. But the director of Institute of Mathematics and Computer Sciences doesn’t like when students carry all these bottles. So the students try to hide their bottles from the director. The Psych Up team invented a special device for that: a dummy guy.
The very first journey showed that the dummy guy can hardly hide two bottles. So you have decided to make a new dummy guy. You have n bottles that can be considered as cylinders of a unit radius. At first you want to draw a circle and place all your bottles inside it so that each of the bottle bottoms touches the circle. What is the minimum radius of such circle?

Input

The only line contains an integer n that is the number of bottles (1 ≤ n ≤ 10).

Output

Output the minimum radius of a circle with an error not exceeding 10−6.

Sample

inputoutput
2
2
Problem Author: folklore
 1 #include <map>
 2 #include <set>
 3 #include <stack>
 4 #include <queue>
 5 #include <cmath>
 6 #include <vector>
 7 #include <cstdio>
 8 #include <cstring>
 9 #include <algorithm>
10 using namespace std;
11 #define maxn 101
12 #define mod 1000000007
13 #define INF 0x7fffffff
14 #define ll long long
15 //#define ll __int64
16 int n, m;
17 int a[maxn];
18 int main(){
19     int cas = 1;
20     while (~scanf("%d", &n)){
21         double a = 180*1.0 / n;
22         if (n == 1){ printf("1\n"); continue; }
23         if (n == 2){ printf("2\n"); continue; }
24         a = a / 180 * 3.1415926;
25         double ans = 1.0 / sin(a);
26         printf("%lf\n", ans+1.0);
27     }
28     return 0;
29 }
View Code 2013-10-19 22:05:55

posted @ 2013-10-19 22:05  HaibaraAi  阅读(137)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3