Pro.ID21688 TitleCover Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21688 AC3 Submit6 Ratio50.00% 时间&空间限制描述Tom wants to cover a rectangular floor by identical L-shape tiles without overlap. As shown below, the floor can be split into many small squares, and the L-shape tile consists of exactly four small squares. The floor of 3×8 can be completely covered by 6 L-shape tiles, but the floor of 3×7 is impossible. Tom would like to know whether an arbitrary floor with n×m small squares can be completely covered or not. He is sure that when n and m are small he can find the answer by paper work, but when it comes to larger n and m, he has no idea to find the answer. Can you tell him? 输入The input file will consist of several test cases. Each case consists of a single line with two positive integers m and n ( 1 ≤ m ≤ 15, 1 ≤ n ≤ 40 ). The input is ended by m=n=0. 输出Description Tom wants to cover a rectangular floor by identical L-shape tiles without overlap. As shown below, the floor can be split into many small squares, and the L-shape tile consists of exactly four small squares. The floor of 3×8 can be completely covered by 6 L-shape tiles, but the floor of 3×7 is impossible. Tom would like to know whether an arbitrary floor with n×m small squares can be completely covered or not. He is sure that when n and m are small he can find the answer by paper work, but when it comes to larger n and m, he has no idea to find the answer. Can you tell him? Input The input file will consist of several test cases. Each case consists of a single line with two positive integers m and n ( 1 ≤ m ≤ 15, 1 ≤ n ≤ 40 ). The input is ended by m=n=0. Output For each case, print the word 'YES' in a single line if it is possible to cover the m×n floor, print 'NO' otherwise. Sample Input 3 8 Sample Output YES Source 样例输入3 8 样例输出YES 作者 |