The number of ways to partition a set of size $n$ into exactly $m$ non-empty subsets is called the Stirling number of the second kind, written $S(n, m)$.
For example, when $n = 4$ and $m = 2$ there are 7 ways:
$S(n, m)$ can be computed with the following recurrence:
Given $n$ and $m$ with $1 \le m \le n$, write a program that prints $0$ if $S(n, m)$ is even and $1$ if it is odd.
The first line contains the number of test cases $D$ ($1 \le D \le 200$).
Each of the following $D$ lines contains one test case: two integers $n$ and $m$ separated by a space ($1 \le m \le n \le 10^9$).
For each test case, print $0$ if $S(n, m)$ is even or $1$ if it is odd, one result per line.