← All problemsSign in

Seated Together

CodeChefRating 136Open on judge ↗

A bus has $100$ seats arranged in $20$ rows, with $5$ seats in each row. Seats $1$ to $5$ are in the first row, seats $6$ to $10$ are in the second row, and so on. Chef and Chefina are seated in seats $X$ and $X+1$, respectively. They can talk to each other during the journey if and only if both seats are in the same row. Given $X$, determine whether Chef and Chefina will be able to talk to ea

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