Hide
Problem B
EvenOdd
Consider the following function
function f(X): iterations := 0 while X is not 1: if X is even: divide X by 2 else: add 1 to X add 1 to iterations return iterations
It can be shown that for any positive integer
Input
The first and only line of input contains two integers
Output
Output the result
Sample Input 1 | Sample Output 1 |
---|---|
1 127 |
1083 |
Sample Input 2 | Sample Output 2 |
---|---|
74 74 |
11 |