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. Delphi 调用串口例子

    procedure TfrmClientMain.SayAddr;var sbuf:array[1..7] of byte;begin sbuf[1]:=byte($35); sbuf[2]:=byt ...

  2. HLS -- m3u8档案格式解析

    1. Playlist file 一个M3U的 Playlist 就是一个由多个独立行组成的文本文件,每行由回车/换行区分.每一行可以是一个URI.空白行或 是以”#“号开头的字符串,并且空格只能存在 ...

  3. Linux下动态库生成和使用

    Linux下动态库生成和使用 一.动态库的基本概念 1.动态链接库是程序运行时加载的库,当动态链接库正确安装后,所有的程序都可以使用动态库来运行程序.动态链接库是目标文件的集合,目标文件在动态链接库中 ...

  4. 《Java数据结构与算法》笔记-CH4-4循环队列

    /** * 循环队列 */ class Queue { private int maxSize; private long[] queue; private int front; private in ...

  5. Shell脚本文件中常用的操作语句

    1. 清空文件中的内容 cat  /dev/null  >> /var/log/messages 2. 脚本中判断用户是不是root用户 ROOT_UID = 0            # ...

  6. gpgcheck

    warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY Public key for co ...

  7. 第二百一十八天 how can I 坚持

    真的是自以为是吗?或许是我想太多. 今天下雪了,2015年入冬以来的第一场雪,好冷. 又是一周. 睡觉吧,明天老贾生日. 没啥了,中午有点肚子疼,冬天了要注意.

  8. 在Windows Server2008R2中导入Excel不能使用Jet 4.0的解决方法

    一直使用以下代码从Excel中取数据,速度快方便: string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Dat ...

  9. unigui 导入导出数据

    导入:首先要用TUniFileUpload将文件从客户端上传至服务端,然后完成导入. TUniFileUpload上传文件的演示代码: UniFileUpload1.Execute; UniFileU ...

  10. Codeforces 27E. Number With The Given Amount Of Divisors (暴力)

    题目链接:http://codeforces.com/problemset/problem/27/E 暴力 //#pragma comment(linker, "/STACK:1024000 ...