← All problemsSign in

Minimum Divisibility Set

CodeChefRating 3204Open on judge ↗

Consider any two sets of integers strictly larger than $1$, denoted by $P$ and $Q$. The set $P$ is said to be *divisible* by $Q$ if each integer in $P$ is divisible by at least one (not necessarily the same for each of them) integer in $Q$. You are given a set $A = \{A_1, A_2, \ldots, A_N\}$, where $A_i \le C$ for each valid $i$ (note that $C$ does not necessarily equal $\max(A)$). Find any set

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