Conductors

Background

Everyone making translations from English to Russian knows an English phrase "Naked conductor runs along the bus". It has two very different meanings.

Problem

Every bus in the Ekaterinburg city has a special man (or woman) called conductor. When you ride the bus, you have to give money to the conductor. We know that there are more than P% conductors and less than Q% conductors of all citizens of Ekaterinburg. Your task is to determine a minimal possible number of Ekaterinburg citizens. By percentage, we know that there are more than P% conductors and less than Q% conductors of all Russian citizens in this city

Input

Two numbers PQ such that 0.01 ≤ PQ ≤ 99.99. Numbers are given with 2 digits precision. These numbers are separated by some spaces or "end of line" symbols.

Output

The minimal number of Ekaterinburg citizens.

Example

input output
13
14.1
15

Notes

If there are 15 citizens and 2 conductors among them in Ekaterinburg, then there are 13 1/3 % conductors of all citizens.
 
 
 
//简单的题目,意思就是要 n 个售票员,all 是总人口 % < n / all * 100% < r % 问,满足这公式需要的最少的总人口是多少
要注意的其实就是 浮点数的比较,一般认为,两浮点数相差大于 10e-8 就认为不同了
 #include <stdio.h>
#include <math.h> int main()
{
double p,q;
double l,r;
while (scanf("%lf%lf",&p,&q)!=EOF)
{
for (int i=;i<=;i++)
{
l=i*p/;
r=i*q/;
int L=floor(l);
int R=floor(r);
if (R-L>=&&fabs(l-L)>1e-&&fabs(r-R)>1e-)
{
printf("%d\n",i);
break;
}
}
}
return ;
}
 
 
 
 
 
 
 

Conductors(水题)的更多相关文章

  1. HDOJ 2317. Nasty Hacks 模拟水题

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  2. ACM :漫漫上学路 -DP -水题

    CSU 1772 漫漫上学路 Time Limit: 1000MS   Memory Limit: 131072KB   64bit IO Format: %lld & %llu Submit ...

  3. ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)

    1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 112[ ...

  4. [poj2247] Humble Numbers (DP水题)

    DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...

  5. gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,

    1195: 相信我这是水题 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 821  Solved: 219 Description GDUT中有个风云人 ...

  6. BZOJ 1303 CQOI2009 中位数图 水题

    1303: [CQOI2009]中位数图 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 2340  Solved: 1464[Submit][Statu ...

  7. 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题

    B - 大还是小? Time Limit:5000MS     Memory Limit:65535KB     64bit IO Format: Description 输入两个实数,判断第一个数大 ...

  8. ACM水题

    ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: ...

  9. CF451C Predict Outcome of the Game 水题

    Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit ...

随机推荐

  1. 一起学Netty(一)之 Hello Netty

    一起学Netty(一)之 Hello Netty 学习了:https://blog.csdn.net/linuu/article/details/51306480

  2. android项目 之 记事本(13) ----- 查看图片及播放录音

    本文是自己学习所做笔记,欢迎转载.但请注明出处:http://blog.csdn.net/jesson20121020 今天就来实现下查看图片及录音的功能,在编辑或者浏览记事时,点击图片.打开一个自己 ...

  3. 如何Tomcat注册成系统服务

    1.开始->运行(windos+r)中敲cmd,DOS界面2.cd到tomcat的bin目录下3.运行命令service.bat install      这里可以指定注册服务的名字,然后就可以 ...

  4. VENOM cve-2015-3456 Qemu 虚拟机逃逸漏洞POC

    #include <sys/io.h> int main() { int i ; iopl(3); outb(0x8e, 0x3f5); outb(0x41, 0x3f5); outb(0 ...

  5. Unity3D 中脚本执行的先后顺序

    Unity3D本身自带有控制脚本执行先后顺序的方法: Edit ---> Project Settings ---> Script Execution Order  ---> 值越小 ...

  6. S2:外观模式 Facade

    为子系统中的一组接口提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用. 什么时候使用:1,开发阶段,子系统越来越复杂,增加外观模式提供一个简单的调用接口.2,维护一个大 ...

  7. eclipse maven tools.jar找不到y也就是在这个

    Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile ...

  8. js控制div内的滚动条的位置

    通过div的scrollTop变动控制垂直滚动条位置. 通过div的scrollLeft变动控制水平滚动条位置. 示例: <body> //d1是外层div,带滚动条 <div id ...

  9. pomodoro源码

    有网友问我要pomodoro源码.事实上这个程序非常easy,仅仅是定时器,定时弹出置顶窗体.用c++builder6.0写.放一个TPopupMenu 右键菜单,一个TTrayIcon 一个托盘图标 ...

  10. MvcPager 分页示例 — 应用CSS样式

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 @model PagedList<string>   <h5>Digg style:</h5> ...