博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
A. Kirill And The Game
阅读量:4932 次
发布时间: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

你可能感兴趣的文章
.Net Core Identity外面使用Cookie中间件
查看>>
【坐在马桶上看算法】算法1:最快最简单的排序——桶排序
查看>>
C#中泛型之Dictionary
查看>>
强连通分量
查看>>
Linux 入门 bash语句 第三课
查看>>
LeetCode 27. 移除元素
查看>>
【原创】phpcms v9 0day
查看>>
杂谈SharpDx中的WIC组件——我们需要WIC的图片编码功能么?
查看>>
移动端弹性盒
查看>>
觉得比较重要的一张触发器的图,高手跳过哈!
查看>>
JAVA中使用jcifs集成AD域用户认证
查看>>
SSH框架 jar包版本的选择
查看>>
1699. Turning Turtles
查看>>
1048. Find Coins (25)
查看>>
(八十六)使用系统自带的分享框架Social.framework
查看>>
C# 使用IP端口网络打印图片
查看>>
OSI与TCP/IP你了解多少?
查看>>
压缩解压缩相关基础知识
查看>>
javaweb之MVC设计模式
查看>>
[APIO2015]巴厘岛的雕塑
查看>>