Wild Pets
CodeChefOpen on judge ↗
Jignesh works at a pet shop. The shop owner recently bought $X$ wild dogs and $Y$ wild cats. The new dogs and cats are not very friendly, the dogs keep fighting among themselves and the cats do the same. The shop owner assigned Jignesh a task to arrange the animals in the cage in such a way that there are neither two adjacent dogs nor two adjacent cats. Jignesh has no idea how to do this so he ha
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