博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
A. Kirill And The Game
阅读量:4933 次
发布时间:2019-06-11

本文共 1356 字,大约阅读时间需要 4 分钟。

A. Kirill And The Game
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Kirill plays a new computer game. He came to the potion store where he can buy any potion. Each potion is characterized by two integers — amount of experience and cost. The efficiency of a potion is the ratio of the amount of experience to the cost. Efficiency may be a non-integer number.

For each two integer numbers a and b such that l ≤ a ≤ r and x ≤ b ≤ y there is a potion with experience a and cost b in the store (that is, there are (r - l + 1)·(y - x + 1) potions).

Kirill wants to buy a potion which has efficiency k. Will he be able to do this?

Input

First string contains five integer numbers l, r, x, y, k (1 ≤ l ≤ r ≤ 107, 1 ≤ x ≤ y ≤ 107, 1 ≤ k ≤ 107).

Output

Print "YES" without quotes if a potion with efficiency exactly k can be bought in the store and "NO" without quotes otherwise.

You can output each of the letters in any register.

Examples
Input
1 10 1 10 1
Output
YES
Input
1 5 6 10 1
Output
NO 其实挺水的,但是我也哇了两次.
1 #include 
2 #define ll long long int 3 using namespace std; 4 int main(){ 5 int l,r,x,y,k; 6 cin>>l>>r>>x>>y>>k; 7 for(ll i=x;i<=y;i++){ 8 if(k*i>=l&&k*i<=r){ 9 cout<<"YES"<

 

转载于:https://www.cnblogs.com/zllwxm123/p/7460207.html

你可能感兴趣的文章
关于C#中怎样实现点ENTER键就相当于按下确认输出按钮
查看>>
jqGrid 是一个用来显示网格数据的jQuery插件
查看>>
windows 下 gcc/g++ 的安装
查看>>
登陆后跳转到指定页
查看>>
[前端插件]为自己的博客增加打赏功能
查看>>
测试阶段的工作进度
查看>>
《将博客搬至CSDN》
查看>>
ExtJS 刷新后,默认选中刷新前最后一次选中的节点
查看>>
实现一个简单的shell(2)
查看>>
Window 常用命令
查看>>
SMTP协议学习笔记
查看>>
ubuntu18.04下安装eclipse jee
查看>>
在ASP.NET MVC中使用Web API和EntityFramework构建应用程序
查看>>
iOS OpenGL ES简单绘制三角形
查看>>
.NET Core 中正确使用 HttpClient 的姿势
查看>>
【转】Python之文件读写
查看>>
ACM-栈
查看>>
C# 泛型集合
查看>>
new和声明的不同
查看>>
Servlet
查看>>