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

建议使用的浏览器:

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

5660:jrMz and angles

题目描述
jrMz has two types of angles, one type of angle is an interior angle of $n$-sided regular polygon, and the other type of angle is an interior angle of $m$-sided regular polygon. jrMz wants to use them to make up an angle of 360 degrees, which means, jrMz needs to choose some or none of the angles which belong to the first type and some or none of the angles which belong to the second type so that the sum value of the angles chosen equals 360 degrees. But jrMz doesn’t know whether it is possible, can you help him?
输入解释
The first line contains an integer $T\left(1\leq T\leq10\right)$——The number of the test cases.
For each test case, the only line contains two integers $n,m\left(1\leq n,m\leq100\right)$ with a white space separated.
输出解释
For each test case, the only line contains a integer that is the answer.
输入样例
3
4 8
3 10
5 8
输出样例
Yes
Yes
No

提示
In test case 1, jrMz can choose 1 angle which belongs to the first type and 2 angles which belong to the second type, because 90+135+135=360.
In test case 2, jrMz can choose 6 angles which belong to the first type, because6\times60=360.
In test case 3, jrMz can’t make up an angle of 360 degrees.
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5660

最后修改于 2020-10-25T23:24:36+00:00 由爬虫自动更新

共提交 0

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