zoukankan      html  css  js  c++  java
  • bestcoder Round #79 (div.2)jrMz and angles

    jrMz and angles

    Accepts: 594
    Submissions: 1198
    Time Limit: 2000/1000 MS (Java/Others)
    Memory Limit: 65536/65536 K (Java/Others)
    Problem Description

    jrMz has two types of angles, one type of angle is an interior angle of nnn-sided regular polygon, and the other type of angle is an interior angle of mmm-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?

    Input

    The first line contains an integer T(1≤T≤10)Tleft(1leq Tleq10 ight)T(1T10)——The number of the test cases. For each test case, the only line contains two integersn,m(1≤n,m≤100)n,mleft(1leq n,mleq100 ight)n,m(1n,m100) with a white space separated.

    Output

    For each test case, the only line contains a integer that is the answer.

    Sample Input
    3
    4 8
    3 10
    5 8
    
    Sample Output
    Yes
    Yes
    No
    
    
    Hint
    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 imes60=360. In test case 3, jrMz can’t make up an angle of 360 degrees.
  • 相关阅读:
    软件构架实践_阅读笔记04(-11)
    软件构架实践_阅读笔记03(7-9)
    Tsinsen-A1488 : 魔法波【高斯消元+异或方程组】
    Tsinsen-1487:分配游戏【树状数组】
    Tsinsen-1486:树【Trie树 + 点分治】
    Splay初步【bzoj1503】
    Treap初步
    [BZOJ3207] 花神的嘲讽计划Ⅰ
    可持久化Trie树初步
    可持久化线段树初步
  • 原文地址:https://www.cnblogs.com/cniwoq/p/6770956.html
Copyright © 2011-2022 走看看