DRAGONS AND GROUPS
CodeChefOpen on judge ↗
$Daenerys$ $Targaryen$ is about to attack $The$ $King's$ $Landing$ with all her dragons. She divides them into $N$ groups. Each group contains $A_i$ dragons $i$ $=$ $[1,2,3,4,...N]$. To win this war, each group should contain exactly $K$ (maximum capacity of each group) dragons and $Daenerys$ is left with $X$ dragons. $Daenerys$ asks your help to distribute the $X$ dragons to groups such that m
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