← All problemsSign in

Two Groups

CodeChefRating 2082Open on judge ↗

This problem has no story, so we at least wish you good luck solving it. Consider a multiset $S$ which contains $A$ copies of the integer $1$, $B$ copies of $2$ and $C$ copies of $3$. For example, if $A = 3$, $B = 3$ and $C = 3$, then $S = \{1, 1, 1, 2, 2, 2, 3, 3, 3\}$. Your goal is to divide the elements of $S$ into two groups (multisets); each element of $S$ must be in exactly one of thes

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