Collatz Peak
Following the same Collatz process to 1, print the LARGEST value the sequence ever reaches (including N itself).
Input: one integer N.
Output: the maximum value on the trajectory.
Constraints:
- 1 ≤ N ≤ 106
Sample Tests
Input 1
7
Output 1
52
Input 2
1
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.