← All problemsSign in

Transform to 0

You are given $Q$ queries. Each query consists of a single number $N$. You can perform any of the $2$ operations on $N$ in each move: 1: If we take 2 integers $a$ and $b$ where $N = a*b (a \neq 1, b \neq 1)$, then we can change $N = max(a, b)$ 2: Decrease the value of $N$ by 1. Determine the minimum number of moves required to reduce the value of $N$ to $0$. ###Input: -The first line contains

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