#P1869. 愚蠢的组合数
愚蠢的组合数
Description
Recently the teacher taught Doggy how to compute combinations, and Doggy came up with another problem...
Doggy defines as the number of ways to choose elements from elements without repetition.
Doggy wants to know the parity of .
Of course, the person who is always using long multiplication to compute all day won’t let you off easy. They say: “ and 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 , the number of test cases.
Lines through each contain two non-negative integers and , describing each test case. The input guarantees .
Output Format
For each test case, output if is odd; otherwise output .
3
1 1
1 0
2 1
1
1
0
Hint
Constraints
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号