Welcome to ZOJ
Information
Problems
Runs
Statistics
Ranklist
Clarification
67 - ZOJ Monthly, June 2008 - 1001
(1+x)^n

Time Limit: 2 Seconds      Memory Limit: 65536 KB

Please calculate the coefficient modulo 2 of x^i in (1+x)^n.

Input

For each case, there are two integers n, i (0<=i<=n<=2^31-1)

Output

For each case, print the coefficient modulo 2 of x^i in (1+x)^n on a single line.

Sample Input

3 1
4 2

Sample Output

1
0

Author: ZHANG, Rui


Submit    Status