当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1222:Wolf and Rabbit

题目描述
There is a hill with n holes around. The holes are signed from 0 to n-1.



A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlockwise order. The first hole he get into is the one signed with 0. Then he will get into the hole every m holes. For example, m=2 and n=6, the wolf will get into the holes which are signed 0,2,4,0. If the rabbit hides in the hole which signed 1,3 or 5, she will survive. So we call these holes the safe holes.
输入解释
The input starts with a positive integer P which indicates the number of test cases. Then on the following P lines,each line consists 2 positive integer m and n(0<m,n<2147483648).
输出解释
For each input m n, if safe holes exist, you should output "YES", else output "NO" in a single line.
输入样例
2
1 2
2 2
输出样例
NO
YES
来自杭电HDUOJ的附加信息
Author weigang Lee
Recommend Ignatius.L

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-1222

最后修改于 2020-10-25T22:43:02+00:00 由爬虫自动更新

共提交 3

通过率 66.67%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)