Skycity

来源:互联网 发布:手机远程监控软件 编辑:程序博客网 时间:2024/06/09 17:34

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 Rr (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 5300 50 2000 500 10

Sample Output

149968.3082196020.459
题意:给一个圆锥塔,每层用玻璃棱柱包裹圆柱,求总的玻璃面积

#include<iostream>#include<cstdio>#include<cmath>using namespace std;const double Pi=acos(-1.0);int main(){double R,r,H,S,F;while(scanf("%lf%lf%lf%lf%lf",&R,&r,&H,&F,&S)!=EOF){double h=H/F,d=(R-r)/F,ans=0;for(int i=0;i<F;i++){double rr=r+i*d;int n=Pi/atan(S/2/h/rr);ans+=2*rr*tan(Pi/n)*n*h;}printf("%.3lf\n",ans);}return 0;}

思路:根据玻璃面的最小面积,求出每层最小的正多边形



0 0
原创粉丝点击