Distribute Medals
CodeChefOpen on judge ↗
Surya is very good at playing the piano and hence participates in music competitions with his friends. One day he has won $M$ medals in a competition. He wants to distribute some medals among his $N$ friends. Surya wants to give $N$ bigger medals and $N$ smaller medals out of $M$ medals to $N$ of his teammates. It is given that $M$ is always greater than or to equal to $2$ × $N$. As Surya is bus
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