← 返回 microsoft 的题目列表Minimum Operations to Transform an Integer Using ±2^i Steps
类型:online_judge
Given two integers start and target. In one operation, you may choose a non-negative integer i and either add 2^i to the current value or subtract 2^i from it. Each add/subtract counts as one operation.
Return the minimum number of operations required to transform start into target.
Input
One line with two integers: start target.
Output
Print a single integer: the minimum number of operations.
Constraints
-10^18 ≤ start, target ≤ 10^18
i can be any non-negative integer such that 2^i fits in 64-bit (i.e., 0 ≤ i ≤ 60).
Examples
Input:
3 11
Output:
1
Input:
10 3
Output:
3
Example
Input
3 11
Output
1