TNP CHALLENGE 503
CodeChefOpen on judge ↗
Maths teacher of ABC School gives an assignment to his students. The Assignment consists of 10 questions. One of his student David was able to do all question except the last one. The Question is An iterative function f(x) is defined as: f(x) = x/2 (if x is even) f(x) = 3x + 1 (if x is odd) for example if x = 40, it generate the following Chain: 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 The
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