← All problemsSign in

Purify It

CodeChefRating 3198Open on judge ↗

*This problem has subtasks.* You are given two integers $L$ and $R$ ($L \leq R$). You want to *purify* each integer in this range. To purify an integer $x$ between $L$ and $R$, you must pay a cost, which is computed as follows: - Choose a positive integer $k$ and some integers $a_1, a_2, \ldots, a_k$ such that: - $L \leq a_i \leq R$ for each $i$. - $\text{lcm}(a_1, a_2, \ldots, a_k) = x

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