Category

Similar Problems

0186. Bitli tenglama

Time limit : 1000 ms
Memory limit : 64 mb

Sizga quyidagicha tenglama berilgan:


$$x+y=x|y$$


Siz ushbu tenglamaning $k$-eng kichik natural yechimini topishingiz kerak.


Kiruvchi ma’lumotlar: Ikkita butun son – $x, k$ ($1\le x,k \le 2 \cdot 10^9$)


Chiquvchi ma’lumotlar: Tenglamaning $k$-eng kichik natural yechimi – $y$ sonini chiqaring.

Input
5 1
Output
2
Input
5 5
Output
18
Input
10 3
Output
5
Input
1 1000000000
Output
2000000000