The Land of Justice

来源:互联网 发布:qq游戏hd登录网络异常 编辑:程序博客网 时间:2024/05/16 14:09

The Land of Justice

In the Land of Justice the selling price of everything is xed 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 mathe-
maticians.
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 pro t
things.
Here your job is to calculate the business pro t for a solid sphere. A businessman buys a complete
sphere and to maximize his pro t he divides it in
n
equal parts. All cut should go through the axis of
the sphere. And every part should look like the picture below:
Input
You are given a sequence of integers
N
(0
<N<
2
31
), indicating the numbers of parts of the sphere.
The input le is terminated with a negative number. This number should not be processed.
Output
Calculate the pro t over the sold pieces. The result should be in percentage and rounded to the nearest
integer.
SampleInput
2
2
-1
SampleOutput
50%
50%

大意:

给出出一个球,然后将它切成N等分,计算等分后增加的表面积比原来的表面积增加了多少;

要点:

注意N= 1是为0%

代码:

#include <stdio.h>int main(){long long n;while (scanf ("%lld", &n) && n >= 0){getchar();if (n <= 1)printf ("0%%\n");elseprintf ("%lld%%\n", 25*n);}return 0;}



0 0
原创粉丝点击