← All problemsSign in

Group of Socks

Naresh has R red socks, G green socks and B blue socks. He decided to divide all the socks into some groups. All the colours, red, green and blue are his favourite, so he wants each group to have at least 1 red, at least 1 green and at least 1 blue sock. Can you help Naresh find maximum number of groups he can create satisfying given condition? Input Input consists of three integers R,G and B

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