10499-The Land of Justice

Source: Internet
Author: User

Problem H
The Land of Justice
Input: standard input
Output: standard output
Time Limit: 4 seconds

 

In the Land of Justice the selling price of everything is fixed all over the country. nobody can buy a thing and keep 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 specified 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 wocould calculate the profit things.

 

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 in n equal parts. all cut shoshould go through the axis of the sphere. and every part shoshould look like the picture below:

 

 

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 shoshould not be processed.

 

Output

Calculate the profit over the sold pieces. The result shocould be in percentage and rounded to the nearest integer.

 

Sample input

2

2

-1

 
Sample output
50%

50%

 

[Cpp] # include <stdio. h>
Int main ()
{
Double n;
While (scanf ("% lf", & n )! = EOF & n> = 0)
{
If (n <= 1)
Puts ("0% ");
Else
Printf ("%. 0lf % \ n", 25 * n );
}
Return 0;
}

# Include <stdio. h>
Int main ()
{
Double n;
While (scanf ("% lf", & n )! = EOF & n> = 0)
{
If (n <= 1)
Puts ("0% ");
Else
Printf ("%. 0lf % \ n", 25 * n );
}
Return 0;
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.