Time limit
2s
Memory limit
128 MB
You are given two positive integers X and K. List all positive integers Y that satisfy the following equation in increasing order, and find the K-th smallest such Y.
X + Y = X | YHere, | denotes the bitwise OR operation.
The first line contains two positive integers X and K, separated by a space.
Each of X and K is at most 2,000,000,000.
Print the K-th smallest positive integer Y satisfying X + Y = X | Y.
The answer may be greater than 2^31 - 1.
X + Y = X | Y