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. 查看Linux服务器CPU使用率、内存使用率、磁盘空间占用率、负载情况

    [root@server script]# vi monitor.py #!/usr/bin/env python # -*- coding:utf-8 -*- #Author: nulige imp ...

  2. Linux用ps命令查找进程PID再用kill命令终止进程的方法

    使用linux操作系统,难免遇到一些软件"卡壳"的问题,这时就需要使用linux下强大的kill命令来结束相关进程.这在linux系统下是极其容易的事情,你只需要kill xxx即 ...

  3. django使用类做业务逻辑

    在django中一般定义一个带有request参数的函数用来处理url,但是更推荐用类做 从django.views.generic.base 导入的views有get,post等各种函数,用来处理对 ...

  4. Linux增加挂载盘

    命令:fdisk /dev/sdb, m 命令:m,n,e,1,p,w 命令:mkfs -t ext4 /dev/sdb,y 挂载命令:mount -t ext4 /dev/sdb /data 获取U ...

  5. 2017.10.13 unable to open debugger port(127.0.0.1:10308)

    参考来自:http://blog.csdn.net/qq_34360219/article/details/76169653 1.场景 突然间IDEA就跑不起项目了,报了如下的错误:unable to ...

  6. 2017.8.5 Linux达人养成计划 I (上)

    参考来自:http://www.imooc.com/learn/175 1 linux简介 1.1 linux简介 linux分为了内核版本和发行版本. 二者的区别:内核版本是由官方提供,而不同的发行 ...

  7. CodeForces 659E New Reform

    题意:给你一个无向图,如今要求你把边改成有向的. 使得入度为0的点最少,输出有多少个点入度为0 思路:脑补一波结论.假设有环的话显然没有点入度为0,其余则至少有一个点入度为0,然后就DFS一波就能够了 ...

  8. JSON Web Token (JWT) 实现与使用方法

    1. JSON Web Token是什么 JSON Web Token (JWT)是一个开放标准(RFC 7519),它定义了一种紧凑的.自包含的方式,用于作为JSON对象在各方之间安全地传输信息.该 ...

  9. HDU-1165-Eddy&#39;s research II

    这个事实上是一个递归题.题目非常easy.m的数非常小.分三种情况.算一下.就能够直接把公式算出来. 当然,也能够用dp做: #include<iostream> #include< ...

  10. E - Hangover(1.4.1)

    Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Submit cid=1006#sta ...