Collatz is here!
CodeChefOpen on judge ↗
The 3n+1 sequence is generated as follows. Starting from a number n, we get the next number in the sequence by doing this: - If n is even, the next number is n/2. - If n is odd, the next number is 3n+1. We continue this way until we reach 1. ### Input - First line will contain $T$, number of testcases. Then the testcases follow. - Each testcase contains of a single line of input, two integers $
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start