Game of 3 and 2
CodeChefOpen on judge ↗
The chef likes to play with numbers. He takes some integer number x, writes it down on his iPad, and then performs with it n−1 operations of the two kinds: 1. divide the number x by 3 (x must be divisible by 3); 2. multiply the number x by 2. After each iteration, Chef writes down the result on his iPad and replaces x with the result. So there will be n numbers on the iPad after all. You
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