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. Golang做的验证码(2)

    前面一篇文章介绍了2个用Golang做的验证码 http://www.cnblogs.com/ghj1976/p/3392847.html  这里再补充几个: 1.在GAE上使用的Google的验证码 ...

  2. python27+django创建app

    python manage.py startapp polls创建一个叫polls的app 编辑文件 polls/models.py : 1 from django.db import models ...

  3. css3.0新属性效果在ie下的解决方案(兼容性)

    css3.0增加的新属性,如投影.渐变.旋转.圆角等等!这些新标准属性在ie6.ie7.ie8浏览器版本里得不到很好的支持,相信ie以后的新版本也会支持这些新属性的.目前ie6.ie7.ie8浏览器不 ...

  4. xp的虚拟机如何访问本地主机上的文件

    1.选中虚拟机,右键选择Settings,在options选项卡里选择Shared Folders,然后在右边设置要共享的文件夹. 2.power on 虚拟机,然后在虚拟机的VM菜单中,选择“Ins ...

  5. “内部类” 大总结(Java)

    (本文整理自很久以前收集的资料(我只是做了排版修改),作者小明,链接地址没有找到,总之感谢,小明) (后面也对"静态内部类"专门做了补充) 内部类的位置: 内部类可以作用在方法里以 ...

  6. 动手动脑之查看String.equals()方法的实现代码及解释

    动手动脑 请查看String.equals()方法的实现代码,注意学习其实现方法. 第一个是false,后三个是true. package stringtest; public class Strin ...

  7. 关于Bean

    什么是Bean? 一个Bean 就是一个类.我们不必为制造任何的Bean而编写一些特殊的代码或者使用特殊的编程语言.事实上,我们唯一需要做的是略微地修改我们对我们方法命名的办法.方法名通知应用程序构建 ...

  8. 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误

    原因1:给定目录下jvm.dll不存在. 对策:(1)重新安装jre或者jdk并配置好环境变量.(2)copy一个jvm.dll放在该目录下. 原因2:eclipse的版本与jre或者jdk版本不一致 ...

  9. Hadoop Java开发实用快捷键收藏

    不断总结更新.... Alt  +  /    补全 Ctrl + T 打出结构 Ctrl + 2 ,再选择 Quick Assist - Assign to local variable  Ctrl ...

  10. cocos2dx使用了第三方库照样移植android平台-解决iconv库的移植问题

    当我写这篇文章的时候我是怀着激动的心情的,因为我又解决了一个技术问题.你可能对题目还一知半解,这是什么意思,我之所以要写这篇文章就是要解决当我们在cocos2dx中使用了第三方库的时候,移植到andr ...