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. JDBCUtils工具类

    JdbcUtils.java import java.sql.Connection; import java.sql.SQLException; import javax.sql.DataSource ...

  2. jstl的错误总结与解决方法

    哎,真他娘的无语了,jstl标签竟然还与tomcat的版本有关.一会报错:java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.ge ...

  3. JAVA Eclipse中如何简易的实现消息机制

    大部分情况下,我们需要实现的消息机制无非是某个类得到了数据,需要传递到某个主界面上去显示,可以把这个消息在类中做成全局变量,主界面的类用一个线程定时扫描,如果这个数据不是空,则说明被类刷新了,那么更新 ...

  4. NodeJS中的循环陷阱

    Node.js的异步机制由事件和回调函数实现,一開始接触可能会感觉违反常规,但习惯以后就会发现还是非常easy的. 然而这之中事实上暗藏不少陷阱.一个非常easy遇到的问题就是回到循环的回调函数. e ...

  5. flex布局 (回顾)

    1.父元素 属性 display:flex; // 必写 justify-content: XXX; // 设置子容器沿主轴排列 align-items: XXX; // 设置子容器如何沿交叉轴排列 ...

  6. Nginx:handler模块按处理阶段挂载原理

    参考资料<深入理解Nginx>(陶辉) 在Nginx中,handler模块真正的处理函数通过两种方式挂载到处理过程中,一种方式就是按处理阶段挂载;另外一种挂载方式就是按需挂载. 本次我们将 ...

  7. [JAVA &#183; 0基础]:11.终结者-final

    关于finalkeyword的总结,是非常easy学习和掌握的,大致分为用final修饰的符号常量.类.方法.属性四部分.而这四部分的内容也是我们必须掌握的,非常有用.在项目中常常来利用finalke ...

  8. Ffmpeg音频转码 卡顿(MP2转AAC)

    最好经手一个小的功能将mp2实时流转成AAC并发布成rtmp音频流,本身不是很难的一个需求, 一个晚上就能将功能开发好.功能开发完毕后,找来一音频文件利用Ffmpeg命令将音视频文件推成 实时udp格 ...

  9. DOM概念的区分:Attribute和Property, html()及.text(), .val()

    Attribute就是dom节点自带的属性 例如:html中常用的id.class.title.align等: <div id="immooc" title="慕课 ...

  10. C# 为枚举创建新方法

    可以使用扩展方法添加特定于某个特定枚举类型的功能. 示例在下面的示例中,Grades 枚举表示学生可能在班里收到的字母等级分.该示例将一个名为 Passing 的扩展方法添加到 Grades 类型中, ...