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. TCP经受时延的ACK

    下午看<卷1>的时候,感觉“TCP经受时延ACK”这段看的有些迷糊,最后还算理解了,所以这里记下来以免以后又忘了. 经受时延的ACK就是在接收到数据后不立马确认,而是等到内核的一个定时器到 ...

  2. windows下mysql5.7安装及配置

    装完msi后,复制my-default.ini文件,黏贴为my.ini文件,内容修改如下: # For advice on how to change settings please see# htt ...

  3. [转]Struts标签库详解

    本文转自:http://hi.baidu.com/xzkcz/blog/item/5cf9f91f01beb9f4e0fe0bd4.html   Struts提供了五个标签库,即:HTML.Bean. ...

  4. WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5

    以下是我的程序(取自headfirst Java): import javax.sound.midi.*; public class MiniMiniMusicApp { public static ...

  5. Mysql的AB复制(主从复制)原理及实现

    Mysql复制(replication)是一个异步的复制,从一个Mysql 实例(Master)复制到另一个Mysql 实例(Slave).实现整个主从复制,需要由Master服务器上的IO进程,和S ...

  6. 【转】Linux下的多线程编程

    1 引言 线程(thread)技术早在60年代就被提出,但真正应用多线程到操作系统中去,是在80年代中期,solaris是这方面的佼佼者.传统的 Unix也支持线程的概念,但是在一个进程(proces ...

  7. java&c# dec 加密,通用

    java /** * 解密DES * @param key 密钥,长度必须是8的倍数 * @param data 数据源 * @return 解密内容 */ public final static S ...

  8. HW7.12

    import java.util.Scanner; public class Solution { public static void main(String[] args) { double[] ...

  9. github Top100

    nodejs 文件 var restify = require('restify'), moment = require('moment'), fs = require('fs'), yesterda ...

  10. leetcode@ [273] Integer to English Words (String & Math)

    https://leetcode.com/problems/integer-to-english-words/ Convert a non-negative integer to its englis ...