← All problemsSign in

Three vs Ten

Chef Three and Chef Ten are playing a game with a number X. In one turn, they can multiply X by 3. The goal of the game is to make X divisible by 10. Help the Chefs find the smallest number of turns necessary to win the game (it may be possible to win in zero turns) or determine that it is impossible. ###Input: - First line will contain $T$, number of testcases. Then the testcases follow.

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start