Reading in a Circle
CodeChefOpen on judge ↗
A classroom has N children with Roll Nos 1 to N. They are reading a story with P paragraphs. The teacher makes all thee children sit down in a circle ordered by ascending roll no. Every child must read aloud a paragraph of the story in sequence. For example, if the teacher starts with child 5 the order will be 5, 6, 7 .... N-1, N, 1, 2, .... until the P paragraphs are read. The child who reads th
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