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

2012 Asia Changsha Regional Contest Problem H

Skycity

Time Limit: 2 Seconds                                     Memory Limit: 65536 KB                                                     Special Judge                            

The world's new tallest building is going to be built in Changsha, which will be called as "Skycity". The Skycity is going to be built as a circular truncated cone, radius of its bottom is marked as R, and radius of its top is marked as r, height of the building is marked as H, and there will be F floors with exact the same height in the whole building.

After construction of the building's skeleton, the construction team is going to construct the curtain wall using thousands of glass panes. The curtain wall is installed in each floor. When installing the curtain wall in a floor, first the construction team will measure the radius r' of the ceiling, then they will install the glass curtain wall as a regular prism which can exactly contain the ceiling circle. When constructing the glass curtain wall, all the glass pane has a minimum area requirment S, and amount of glass usage should be as little as possible.

As all the glass has exact the same thickness, so we can calculate the consumption of each glass pane as its area. Could you calculate the minimum total glass consumption?

Input

There will be multiple test cases. In each test case, there will be 5 integers R, r (10 ≤ r < R ≤ 10000), H (100 ≤ H ≤ 10000), F (10 ≤ F ≤ 1000) and S (1 ≤ S < √3 × r × H ÷ F) in one line.

Output

For each test case, please output the minimum total glass consumption, an absolute error not more than 1e-3 is acceptable.

Sample Input

50 10 800 120 5
300 50 2000 500 10

Sample Output

149968.308
2196020.459

                            Author: FAN, Yuzhe                                                     Contest: The 2013 ACM-ICPC Asia Changsha Regional Contest

 1 #include <cstdio>
 2 #include <vector>
 3 #include <cmath>
 4 #include <queue>
 5 #include <cstring>
 6 #include <iostream>
 7 #include <algorithm>
 8 using namespace std;
 9 #define INF 0x7fffffff
10 #define mod 1000000007
11 #define ll long long
12 #define maxn 1005
13 #define pi acos(-1.0)
14 double rm, rr, i, r, x, y, h, f, s, vx, vy, a, b, c, d, d1, d2, v, x2, y2;
15 int main(){
16     while (cin>>rr>>r>>h>>f>>s){
17         d = (rr - r) / f;
18         v = 0; x = r; s = s / 2 / (h / f);
19         for (int i = 0; i < f; i ++){
20             int y = pi/atan(s / x);
21             v += y*x*tan(pi / y)*2.0;
22             x += d;
23         }
24         printf("%.3lf\n", v*h/f);
25     }
26     return 0;
27 }
View Code
posted @ 2013-12-16 14:05  HaibaraAi  阅读(139)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3