Guddu and Socks
CodeChefOpen on judge ↗
Guddu has n pairs of socks. In the morning of each day Guddu has to put on a pair of socks before he goes to school. When he comes home in the evening, Guddu takes off the used socks and throws them away. Every m-th day (at days with numbers m, 2m, 3m, ...) mom buys a pair of socks for Guddu. She does it late in the evening, so that Guddu cannot put on a new pair of socks before the next day. How
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