← All problemsSign in

Paint the Balls 1

**Statement** You are given a sequence of integers a1, a2, a3, ………. upto n terms. You need to paint elements in colours, so that: • If we consider any colour, all elements of this colour must be divisible by the minimal element of this colour. • The number of used colours must be minimized. For example, it’s fine to paint elements [30,5,10] in a single colour, because they are all divi

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