首页 > 其他分享 >The Land of Justice

The Land of Justice

时间:2023-04-14 12:31:43浏览次数:25  
标签:Land business sphere Justice should profit mathematicians


话不多说。。上代码。。

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


#include <stdio.h>
int main()
{
    double a;
    while(scanf("%lf",&a)!=EOF)
    {
        if(a<0) break;
        else if(a <= 1)
            printf("0%%\n");
        else
        printf("%.lf%%\n", 25*a);
    }
    return 0;
}



标签:Land,business,sphere,Justice,should,profit,mathematicians
From: https://blog.51cto.com/u_16070138/6189900

相关文章

  • win10下注册goLand
    win10下注册goLand修改系统时间到2021-4-13号使用以下注册码激活S32PGH0SQB-eyJsaWNlbnNlSWQiOiJTMzJQR0gwU1FCIiwibGljZW5zZWVOYW1lIjoiSmF2YSDlpKfnpZ4iLCJhc3NpZ25lZU5hbWUiOiIiLCJhc3NpZ25lZUVtYWlsIjoiIiwibGljZW5zZVJlc3RyaWN0aW9uIjoiIiwiY2hlY2tDb25jdXJyZW50VXNlIjpm......
  • tryhackem_wonderland
    涉及,解密,扫描,横向移动,纵向移动仙境掉进兔子洞,进入仙境。获得shell解法一:目录扫描ffuf-uhttp://10.10.134.189/FUZZ-w/usr/share/wordlists/dirbuster/directory-list-2.3-small.txt-cffuf-uhttp://10.10.134.189/r/FUZZ-w/usr/share/wordlists/dirbuster/directo......
  • Landscape UI on Portait LCM (竖屏横用/直屏横用)使用
    1.直屏比橫屏便宜許多 2.Qwertykeypadphone(全键盘手机),客戶普遍用”直屏橫放“的方式來实现,但得自己承受performance和tearing(斜切屏)問題.因为使用LCM做90度Rotate,则必然出现斜切屏。3.MTK提供tearing-free(斜切屏解决方法)以及goodperformance。无需LCM......
  • Battleland:Warrior vs Monster HD评测:自动不一定优于手动
    Battleland:WarriorvsMonster是一款结合冒险棋元素的RPG游戏,作为一款以RPG游戏来说,它有不错的角色设计及技能动画,丰富的职业、技能、道具、关卡等内容,但整体来说,它在战斗及团队过于简化的设计导致其娱乐性更像是休闲网页游戏,现在冰点将降价中,有兴趣的童鞋不妨看看评测进一步了......
  • windows系统下goland编辑器安装教程
    goland编辑器下载:https://download.jetbrains.com.cn/go/goland-2022.3.3.exe点击download下载即可,可以免费试用30天下载后,window安装软件,点下一步下一步安装即可 gol......
  • CF1809F Traveling in Berland - 倍增 -
    题目链接:https://codeforces.com/contest/1809/problem/F题解:对一个点,考虑怎样在\(O(\logn)\)的时间复杂度内求出答案,联想到倍增但是,倍增合并的时候只能在两个状态相......
  • WPF Validation - Using INotifyDataErrorInfo | .NET Land (kmatyaszek.github.io)
    WPFValidation-UsingINotifyDataErrorInfo|.NETLand(kmatyaszek.github.io)Inthe.NET4.5wasintroducednewinterface INotifyDataErrorInfo whichenable......
  • GOLAND-激活码-20230309
    33MEHOB8W0-eyJsaWNlbnNlSWQiOiIzM01FSE9COFcwIiwibGljZW5zZWVOYW1lIjoiUG9saXRla25payBNZXJsaW1hdSBNZWxha2EiLCJhc3NpZ25lZU5hbWUiOiJtYWdnaWUgc2VyIiwiYXNzaWduZWVFbWFp......
  • GoLand控制台显示无效内容太多,设置控制台折叠多余信息
    参考自:https://blog.csdn.net/qq_40607566/article/details/1231787311.在GoLand上方菜单栏点击Help->FindAction或者ctrl+shift+a2.单击FindAction,输入Registry3.......
  • Landsat数据在USGS中无法下载Surface Reflectance产品的解决方法
      本文介绍在USGS官网下载Landsat遥感影像数据时,出现报错信息,无法下载地表反射率产品(SurfaceReflectance)的解决办法。  最近,利用这篇文章批量下载Landsat遥感影像的......