Division Sorting
Chef has an array $A$ of length $N$ consisting of **positive** integers. In one move, Chef can do the following: - Pick an index $i \ (1 \leq i \leq N)$ and a [prime number](https://en.wikipedia.org/wiki/Prime_number) $P$, such that $P$ divides $A_i$. - Divide $A_i$ by $P$, i.e, set $A_i := \frac{A_i}{P}$. Find the **minimum** number of moves that Chef needs to make the array $A$ **non-decreasin
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