Programming contests

Informatikai versenyfeladatok, selejtező, 2012. február 6.

February 6, 2012 6:10 PM – February 6, 2012 7:45 PM

The Land of Justice

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.

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 should go through the axis of the sphere. And every part should look like the picture below:

Input Specification

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 Specification

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

Sample Input

  1. 2
  2. 2
  3. -1
download as text file

Output for Sample Input

  1. 50%
  2. 50%
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019