← All problemsSign in

Tedious Task

Once, Ayush's teacher was distributing toffees to N students,standing in a row.Teacher already distributed some toffees to all the students, but he had to leave in middle of it, so he assigned the task to Ayush. Now, Ayush has only M chocolates left with him to distribute. Also, He knew that he had to distribute toffees in such a way that he could show, some continuous subgroups of students, who

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