Bitwise Equations
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
You are given two positive integers x and k. Find the k-th smallest positive integer y (where k is 1-based) for which the following equation holds:
x + y = x | y
where '|' denotes the bitwise OR operator.
Input
Each line is a separate test case which contains two integers x and k (1 ≤ x, k ≤ 2*10^9).
Output
For each test case print in a separate line the k-th smallest positive integer y for which the given above equation holds.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 39%