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. XML序列化成对象

    这个是和ALM上传测试结果结合使用的//把xml序列化成对象以及把对象序列化成xml using System; using System.Data; using System.Configurati ...

  2. javascript正则表达式简介

      javascript正则表达式 javascript正则表达式 regular expression是一个描述字符模式的对象: ECMAScript中的RegExp类表示正则表达式: String ...

  3. OpenGl从零开始之坐标变换(下)

    这节主要来理解投影变换和视口变换的使用. 1.正射投影:glOrtho 函数原型: void glOrtho(GLdouble left,GLdouble right,GLdouble bottom, ...

  4. lua Date和Time

    time和date两个函数在Lua中实现所有的时钟查询功能.函数time在没有参数时返回当前时钟的数值.(在许多系统中该数值是当前距离某个特定时间的秒数.)当为函数调用附加一个特殊的时间表时,该函数就 ...

  5. MapReduce 中job.setJarByClass()方法的疑惑

    在调试mr实例的时候,遇到如下的情况,如图所示 说明:就是我的mr程序类名称和我设置的setJarByclass()中设置的不一样,但是程序竟然没有报错!!!!当时把我吓尿了 疑惑:如果这样设置的话, ...

  6. nagios监控远程主机服务可能出现的问题

    1.使用插件NRPE监控命令不存在 在添加服务的时候,命令配置文件中需要传递一个参数,那么在监控服务配置文件中,需要添加一个!表示后面的为参数. 出现未定义的命令,查看被监控主机上的配置文件,添加监控 ...

  7. 原型模式--prototype

    C++设计模式——原型模式 什么是原型模式? 在GOF的<设计模式:可复用面向对象软件的基础>中是这样说的:用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象.这这个定义中,最 ...

  8. hadoop-1.2.0源码编译

    以下为在CentOS-6.4下hadoop-1.2.0源码编译步骤. 1. 安装并且配置ant 下载ant,将ant目录下的bin文件夹加入到PATH变量中. 2. 安装git,安装autoconf, ...

  9. 创建并使用Windows Azure虚拟机模板

    在现实的IaaS应用中,往往会创建自己的虚拟机映像模板,以满足快速应用部署的目标,如预先配置好某些应用.管理与监控管理等. 1.登录到Windows Azure Dashboard中创建一个做为模板的 ...

  10. VS2010在C#头文件添加文件注释的方法(转)

    步骤: 1.VS2010 中找到(安装盘符以C盘为例)C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCa ...