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

In the Land of Justice theselling price of everything is fixed all over the country. Nobody can buy a thingand sell it in double price. But, that created problems for the businessmen.They left their business and went to the production. So, after some dayseverybody was in production and nobody in business. And the people didn’t gettheir necessary things though the country was self-sufficient in every sector.

The government became very muchanxious. But, they were intelligent enough to call the mathematicians.

The mathematicians gave asolution.  They suggested setting thesurface area of an object as its selling-unit instead of its volume. Actuallythe clever mathematicians were very much interested to establish their ownbusiness.

Now, the government asks theprogrammers to build the software that would calculate the profit things.

Here your job is to calculate thebusiness profit for a solid sphere. A businessman buys a complete sphere and tomaximize his profit he divides it in n equal parts. All cut should gothrough the axis of the sphere. And every part should look like the picturebelow:

Input

You are given a sequence ofintegers N (0 < N < 231), indicating the numbers of parts ofthe sphere. The input file is terminated with a negative number. This numbershould not be processed.

 

Output

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

Sample input

2

2

-1

Sampleoutput

50%

50%

题意: 我简单的说, 把球切拿去切, (按图中所示切 不要乱切哦)

然后问, 表面积比原先的表面积多出了百分之多少?

做法: 看别人的题解, 发现公式是: (n*25)%

除了n = 1时, 答案是 0%

注意点: n * 25 会超, 用long long

AC代码

#include<stdio.h>

long long n;
char ch = '%';
int main() {
while(scanf("%lld", &n) != EOF) {
if(n < 0)
break;
if(n == 1)
printf("0%c", ch);
else
printf("%lld%c", 25 * n, ch);
printf("\n");
}
return 0;
}

UVA 10499 (13.08.06)的更多相关文章

  1. UVA 253 (13.08.06)

     Cube painting  We have a machine for painting cubes. It is supplied withthree different colors: blu ...

  2. UVA 573 (13.08.06)

     The Snail  A snail is at the bottom of a 6-foot well and wants to climb to the top.The snail can cl ...

  3. UVA 10025 (13.08.06)

     The ? 1 ? 2 ? ... ? n = k problem  Theproblem Given the following formula, one can set operators '+ ...

  4. UVA 10790 (13.08.06)

     How Many Points of Intersection?  We have two rows. There are a dots on the toprow andb dots on the ...

  5. UVA 10194 (13.08.05)

    :W Problem A: Football (aka Soccer)  The Problem Football the most popular sport in the world (ameri ...

  6. UVA 465 (13.08.02)

     Overflow  Write a program that reads an expression consisting of twonon-negative integer and an ope ...

  7. UVA 10494 (13.08.02)

    点此连接到UVA10494 思路: 采取一种, 边取余边取整的方法, 让这题变的简单许多~ AC代码: #include<stdio.h> #include<string.h> ...

  8. UVA 424 (13.08.02)

     Integer Inquiry  One of the first users of BIT's new supercomputer was Chip Diller. Heextended his ...

  9. UVA 10106 (13.08.02)

     Product  The Problem The problem is to multiply two integers X, Y. (0<=X,Y<10250) The Input T ...

随机推荐

  1. 【LeetCode】9 & 234 & 206 - Palindrome Number & Palindrome Linked List & Reverse Linked List

    9 - Palindrome Number Determine whether an integer is a palindrome. Do this without extra space. Som ...

  2. 朝鲜RedStar_OS_3.0安装图解

    前天exploit-db上出现了3个Local Exploit,都是来自朝鲜的RedStar 3.0的vul.网上也下到了镜像,按网上的方法测试了下,真的是 ————————————————————— ...

  3. U盘安装RedHat 5.3

    转载自http://www.cnblogs.com/totozlj/archive/2012/06/03/2532757.html 1.下载rhel-5.3-server-i386-dvd.iso文件 ...

  4. ZeroCopyLiteralByteString cannot access superclass

    问题描述 在HBase上运行MapReduce作业时,报如下异常:IllegalAccessError: class com.google.protobuf.HBaseZeroCopyByteStri ...

  5. ios8 下请求读取通讯录权限 (网上众多资料漏下得一个坑)

    读取通讯录权限网上都有,不再叙述. 当第一次授权时用户假如拒绝授权, 第二次就无法再次弹出提示框授权. 刚开始时完全按照网上例子写的,第一次拒绝授权后,在设置里面无法找到对应的更改读取权限的选项. 后 ...

  6. 北信源VRVEIS网管软件测试

    650) this.width=650;" border="0" alt="" src="http://img1.51cto.com/att ...

  7. Bash's ArithmeticExpression

    [Bash's ArithmeticExpression] let command: let a=17+23 echo "a = $a" # Prints a = 40 let a ...

  8. SQL获取变量类型以及变量最大长度

    DECLARE @Temp nvarchar(1050)='' SELECT CAST(SQL_VARIANT_PROPERTY(@Temp, 'BaseType') AS VARCHAR(50))S ...

  9. class list

    class list(object): """ list() -> new empty list list(iterable) -> new list ini ...

  10. JQuery与GridView控件结合示例

    JQuery是一种非常强大的客户端JS编程技术,这里不想过多阐述它的相关背景知识,只想简单演示一下如何与asp.net的控件结合开发. 比如,我们要做一个下面如图所示的功能,效果是状态.编号.数字1. ...