← All problemsSign in

Cats and Rats

CodeChefRating 2641Open on judge ↗

and [Bengali](https://www.codechef.com/download/translated/COOK104/bengali/CATSRATS.pdf) as well. There are $N$ cats (numbered $1$ through $N$) and $M$ rats (numbered $1$ through $M$) on a line. Each cat and each rat wants to move from some point to some (possibly the same) point on this line. Naturally, the cats also want to eat the rats when they get a chance. Both the cats and the rats can o

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