The Land of Justice

2024-08-24 22:38
文章标签 land justice

本文主要是介绍The Land of Justice,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

话不多说。。上代码。。

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

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

 

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

 

The mathematicians gave a solution.  They suggested setting the surface area of an object as its selling-unit instead of its volume. Actually the clever mathematicians were very much interested to establish their own business.

 

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

 

Here your job is to calculate the business profit for a solid sphere. A businessman buys a complete sphere and to maximize his profit he divides it in n equal parts. All cut should go through the axis of the sphere. And every part should look like the picture below:

 

Input

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

 

Output

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

  

Sample input

2

2

-1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
int main()
{double a;while(scanf("%lf",&a)!=EOF){if(a<0) break;else if(a <= 1)printf("0%%\n");elseprintf("%.lf%%\n", 25*a);}return 0;
}

这篇关于The Land of Justice的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1103801

相关文章

the Marvelous Land of Oz 37.9%

"Oh, I see!" Cried the Scarecrow,greatly reassured.

HDU 5050 Divided Land

http://acm.hdu.edu.cn/showproblem.php?pid=5050 Divided Land Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 713    Accepted Submission(s): 339

GEE:Landsat C01和C02数据集进行LST(Land Surface Temperature)地表温度分析

LST(Land Surface Temperature) LST(Land Surface Temperature)是指地表温度,是地表上空气与地表之间的热交换过程的结果。地表温度是一个重要的地理要素,对气候研究、气象预报、农业生产、环境评估等方面有着重要的影响。下面将详细介绍LST的定义、计算方法以及其在不同领域的应用。 首先,LST的定义是指地表的温度,即地球表面的实际温度。它与空气温度

uva 12265 - Selling Land(dp)

题目链接:uva 12265 - Selling Land 题目大意:给出一个图,要求以每个位置为右下角,找出最大周长的矩阵,然后统计所有周长的矩阵。 解题思路:首先可以维护每个位置向上的最大生长高度,然后按照每一行去枚举列,维护一个单调队列,使得高度递增,以及长度最优(在添加的那步进行控制)。对于每个新的长度,将比它高的直接忽略。 #include <stdio.h>

GEE 10m 全球 LULC 数据集 ESRI Land Cover

土地利用土地覆盖(LULC)地图在许多行业部门和发展中国家越来越成为决策者的重要工具。这些地图提供的信息有助于通过更好地理解和量化地球过程和人类活动的影响,从而制定政策和土地管理决策。 ESRI Land Cover 数据介绍 ArcGIS Living Atlas of the World 提供了详细、准确且及时的全球 LULC 地图。该数据是 Esri 和 Impact

LoRA Land: 310个经微调的大语言模型可媲美GPT-4

摘要 低秩自适应 (LoRA) 已成为大语言模型 (LLM) 参数有效微调 (PEFT) 中最广泛采用的方法之一。LoRA 减少了可训练参数的数量和内存使用,同时达到了与全面微调相当的性能。该研究旨在评估在实际应用中训练和服务使用 LoRA 微调的 LLM 的可行性。首先,该研究测量了在 10 个基础模型和 31 个任务上使用量化低秩适配器微调的 LLM 的质量,总共有 310 个模型。研究发现

Android开发中如何匹配layout资源(layout-sw480dp layout-sw600dp-land layout-sw720dp-port)

Android应用里里,大家一定饱受各种layout-sw480dp layout-sw600dp-land layout-sw720dp-port之苦,往往不知道自己的平板加载的是哪个Layout而不得不一个个尝试,网上一大堆说不清的教程。本人查阅很多资料,给大家分享一种计算方法确定自己平板所加载哪个dp的资源。 事实上,sw不是software的,意思,我猜是shortest widt

POJ 1365 Prime Land 整数分解

题解: 在求素数的过程中记录下每个数的最小因素,a[n]表示n的最小因素,例如a[2]=2, a[12] = 3, a[16] = 2······ #include<cstdio>#include<cstring>#include<memory>#include<cmath>using namespace std;const int MAX = 33333;int a[MAX],