Chef and Chocolate
All submissions for this problem are available.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
Chef has a standard chocolate of n by m pieces. More formally, chocolate is a rectangular plate consisting of n rows and m columns.
Here you can see an example of a standard 5 by 7 chocolate.
The only line of each test case contains two space separated integers n and m - the sizes of the chocolate.
For each test case, output a single line containing one word "Yes" (without quotes) if there is a sequence of moves leading to the winning of the person who moves first and "No" (without quotes) otherwise.
- 1 ≤ T ≤ 100
- 1 ≤ n, m ≤ 109
SubtasksSubtask #1 (10 points):
- 1 ≤ n, m ≤ 10
- n = 1 or m = 1
Input: 2 1 2 1 3 Output: Yes No
Example case 1. There is only one possible move, so the second player even won't have a chance to make move.
Example case 2. There are only two ways first player can make first move, after each of them only one move left, so the first player cannot win.
|Tags||antoniuk1, aug16, cakewalk|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.