#P1869. 愚蠢的组合数

愚蠢的组合数

Description

Recently the teacher taught Doggy how to compute combinations, and Doggy came up with another problem...

Doggy defines C(N,K)C(N,K) as the number of ways to choose KK elements from NN elements without repetition.

Doggy wants to know the parity of C(N,K)C(N,K).

Of course, the person who is always using long multiplication to compute 123456789×987654321=?123456789 \times 987654321=? all day won’t let you off easy. They say: “NN and KK can be quite large.”

But Doggy is also stumped, so it comes to you for help to solve this problem.

Input Format

The first line contains a positive integer tt, the number of test cases.

Lines 22 through 2+t12+t-1 each contain two non-negative integers NN and KK, describing each test case. The input guarantees knk\le n.

Output Format

For each test case, output 11 if C(N,K)C(N,K) is odd; otherwise output 00.

3
1 1
1 0
2 1
1
1
0

Hint

Constraints

For 100%100\% of the testdata, 1n1051\le n\le 10^5, 1t1051\le t\le 10^5.

Translated by ChatGPT 5