**Problem Statement:**<br>↵
On the eve of New Year in Dholakpur, Chota Bheem and Chutki are playing a game, described as follows.<br>↵
↵
There are two plates full of Laddus. Both can eat **L** (L>=1) laddus from any _one_ plate or **L** laddus from _both_ the plates in each step. They play the game alternatively and the last one to eat the laddu will be the winner.<br>↵
↵
As Chota Bheem wants to impress Chutki, he wants to make Chutki the winner. You have to help Chota Bheem in deciding who should play first.<br>↵
↵
**Constraints:**<br>↵
1 <= Test cases(T) <= $10^5$<br>↵
0 <= a,b <= $10^6$<br>↵
↵
As i could only come up with an $O(T N^2)$ approach which used $O(N^2)$ space(where N is max(a,b)), I wrote a [brute force](https://ideone.com/243T7t7bAAOK) to see if any pattern existed but failed to find one. <br>↵
What am i missing here ?<br> ↵
Thanks!<br>↵
P.S : You can find the problem statement [here](https://www.hackerearth.com/iupc2k16/algorithm/grab-the-laddu/description/).
On the eve of New Year in Dholakpur, Chota Bheem and Chutki are playing a game, described as follows.<br>↵
↵
There are two plates full of Laddus. Both can eat **L** (L>=1) laddus from any _one_ plate or **L** laddus from _both_ the plates in each step. They play the game alternatively and the last one to eat the laddu will be the winner.<br>↵
↵
As Chota Bheem wants to impress Chutki, he wants to make Chutki the winner. You have to help Chota Bheem in deciding who should play first.<br>↵
↵
**Constraints:**<br>↵
1 <= Test cases(T) <= $10^5$<br>↵
0 <= a,b <= $10^6$<br>↵
↵
As i could only come up with an $O(T N^2)$ approach which used $O(N^2)$ space(where N is max(a,b)), I wrote a [brute force](https://ideone.com/
What am i missing here ?<br> ↵
Thanks!<br>↵
P.S : You can find the problem statement [here](https://www.hackerearth.com/iupc2k16/algorithm/grab-the-laddu/description/).