2013秋13级预备队集训练习4 --C - The Land of Justice
来源:互联网 发布:手机淘宝免费开店流程 编辑:程序博客网 时间:2024/05/16 05:29
Problem H
The Land of Justice
Input: standard input
Output: standard output
Time Limit: 4 seconds
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
In the Land of Justice the selling price of everything is fixed all over the country. Nobody can buy a thing and sell it in double price. But, that created problems for the businessmen. They left their business and went to the production. So, after some days everybody was in production and nobody in business. And the people didn’t get their necessary things though the country was self-sufficient in every sector.
The government became very much anxious. But, they were intelligent enough to call the mathematicians.
The mathematicians gave a solution. They suggested setting the surface area of an object as its selling-unit instead of its volume. Actually the clever mathematicians were very much interested to establish their own business.
Now, the government asks the programmers to build the software that would calculate the profit things.
<!--[if !supportEmptyParas]--> <!--[endif]-->
Here your job is to calculate the business profit for a solid sphere. A businessman buys a complete sphere and to maximize his profit he divides it inn equal parts. All cut should go through the axis of the sphere. And every part should look like the picture below:
<!--[if !supportEmptyParas]--> <!--[endif]-->
Input
You are given a sequence of integers N (0 < N < 231), indicating the numbers of parts of the sphere. The input file is terminated with a negative number. This number should not be processed.
Output
Calculate the profit over the sold pieces. The result should be in percentage and rounded to the nearest integer.
Sample input
2
2
-1
<!--[if !supportEmptyParas]--> <!--[endif]-->
Sample output
50%
50%
这个题就是当球变为那部分计算增加的面积,要注意n==1时 球是没有增加的面积的
#include <stdio.h>int main(){ double n ; while(scanf("%lf",&n)!=EOF) { if(n < 0) break; if(n<=1) printf("0%%\n"); else printf("%.lf%%\n", n*25 ); } return 0;}
- 2013秋13级预备队集训练习4 --C - The Land of Justice
- 2013秋13级预备队集训练习4 --D - How Many Points of Intersection?
- 2013秋13级预备队集训练习4 --A - The Snail
- 2013秋13级预备队集训练习4 --B - Steps
- The Land of Justice
- The Land of Justice
- The Land of Justice
- 第四次集训——The Land of Justice
- 2013秋13级预备队集训练习3--A - Power of Cryptography
- 2013秋13级预备队集训练习3 -- F - Box of Bricks
- 2013秋13级预备队集训练习1 A - Hashmat the Brave Warrior
- 2013秋13级预备队集训练习1 D - The Decoder
- 2013秋13级预备队集训练习1 K - The Collatz Sequence
- 2013秋13级预备队集训练习3 --E - The ? 1 ? 2 ? ... ? n = k problem
- 2013秋13级预备队集训练习2 --A - Palindromes
- 2013秋13级预备队集训练习1 C - Ecological Premium
- 2013秋13级预备队集训练习3 --C - Cube painting
- 2013秋13级预备队集训练习2 --C - Automatic Poetry
- [Effective WX] 有关wxGTK的模态对话框(modal dialog)弹出的非模态窗口的问题
- 我的2013----IT女的一年经历
- linux下解压命令
- C++ string实现
- 小妹的美好时代
- 2013秋13级预备队集训练习4 --C - The Land of Justice
- 10个迷惑新手的Cocoa,Objective-c开发难点和问题
- android 手电筒开发
- 数据结构开发日志
- windows下qt creator中加入qwt插件
- hdu1788 Chinese remainder theorem again
- kafka安装
- Spring学习(0)——Spring架构师对Spring的介绍
- 2013秋13级预备队集训练习4 --D - How Many Points of Intersection?