#P6206. [USACO06OCT] Another Cow Number Game G
[USACO06OCT] Another Cow Number Game G
Problem Description
The cows are playing a number game, and Bessie wants you to help her predict the result. At the start of the game, Bessie is given a positive integer . Her score is at this time.
The cows transform using the following rules:
- If is odd, multiply it by and then add .
- If is even, divide it by .
Each time the number is transformed, Bessie gains point. When , the game ends. The score at this time is her final score.
Input Format
One line containing one integer .
Output Format
One line containing one integer, which is Bessie’s final score.
5
5
Hint
Constraints
For of the testdata, .
Sample Explanation
When the initial value of is , the game proceeds as follows:
| Number after the transformation | Transformation | Total score | |
|---|---|---|---|
Bessie’s final score is .
Translated by ChatGPT 5