博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
POJ 3386 Halloween Hoildays(我的水题之路——两个戒指)
阅读量:4068 次
发布时间:2019-05-25

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

Halloween Holidays
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 2787   Accepted: 1120

Description

Planet Cucurbita is inhabited with intelligent pumpkins. These pumpkins are not only extremely clever, they also are fond of tourism. One of their main routes is the Earth during Halloween.

As you know, pumpkins cannot move by themselves (intelligent pumpkins are not an exception), so they make somebody else to transport them. In the case of Halloween this is done by humans. First, they make people to grow special biological docking stations, then prepare the stations (people cut special holes, fire candles etc – you know the procedure), and after these preparations pumpkins come and have fun. People usually do not see anything and think that this is just a holiday and that this holiday is for humans, but remember – if somebody is frightened at Halloween, he was frightened not by his not-very-friendly friends, but by alien pumpkins.

To use the biological docking station, a pumpkin must have a special transmitter. It’s main elements are two rings made of gold and for some unexplainable reasons these rings should be cut from one round plate. The sizes of these rings (inner and outer radii) are pumpkin-specific, so each alien should order a special set for himself.

Mr. Calabaza, an adolescent pumpkin, wants to make his first trip to the Earth. He found a discount plate, which was not redeemed by a previous customer, and it is necessary to check, whether this plate allows Mr. Calabaza to cut the rings he needs from it, or he should order a new larger plate.

Input

The input file contains five integer numbers AaBbP (0 < AaBbP ≤  1 000 000 , a < A and b < B), separated with spaces. Here, A and B are the outer radii of the rings, a and b are the inner radii of the corresponding rings, and P is the plate radius.

Output

Output a word “Yes” if the plate suits Mr. Calabaza, or a word “No” if he needs to order another one.

Sample Input

2 1 5 3 6

Sample Output

Yes

Hint

Source

, Northern Subregion
需要在一个半径为P的金盘上扣下两个圆环做戒指,两个戒指的外半径分别为A、B,内半径分别为a、b。问是否可以在这个金盘上得到这两个戒指。
根据Hint里的图,知道两个戒指是套在一起的,所以只需要比较是否里面戒指的外半径小于外部戒指的内半径,外部戒指的外半径是是否小于金盘外半径,或者,两个外半径相加小于金盘半径(两个戒指并排)。
代码(1AC):
#include 
#include
int main(void){ int A, a, B, b, P; while (scanf("%d%d%d%d%d", &A, &a, &B, &b, &P) != EOF){ if (A <= b && B <= P || B <= a && A <= P || A + B <= P){ printf("Yes\n"); } else{ printf("No\n"); } } return 0;}

转载地址:http://qloji.baihongyu.com/

你可能感兴趣的文章
web test LoadRunner SAP / java / Java Vuser / web_set_max_html_param_len
查看>>
OS + UNIX AIX command
查看>>
OS + UNIX AIX performance
查看>>
OS + UNIX AIX Tools
查看>>
my ReadBook_liutongjingjixue / circulation economics
查看>>
my ReadBook_wangluoyingxiaoyucehua / network marketing / wangluoyingxiao
查看>>
db base database
查看>>
Spring2.5+MINA2搭建Socket Server
查看>>
jcharts画线图,饼图和柱状图
查看>>
监控服务器端口,Down掉会自动重启,并发送邮件 Linux Shell
查看>>
Git提交错误:RPC failed; result=22, HTTP code = 411
查看>>
Druid使用ConfigFilter
查看>>
Elicpse使用技巧-打开选中文件文件夹或者包的当前目录
查看>>
eclips 运行项目内存不足的解决方案
查看>>
linux 挂载盘阵 smb
查看>>
漫谈 JAVA程序员、架构师、项目经理
查看>>
ceph (luminous 版) crushmap 与 pool结合用于物理划分 IO 使用域
查看>>
mysql 相关索引
查看>>
tomcat7 - cacti 备忘
查看>>
kubernetes 上部署 kubevirt 运行虚拟机
查看>>