BACT
CodeChefOpen on judge ↗
Ravi is bored in his chemistry class. He's playing with intelligent bacteria. He has arranged his K bacteria on a rectangular board divided in N rows, labelled with numbers from 1 to N starting from the top, and M columns, labelled with numbers from 1 to M starting from the left. Each bacterium begins its adventure in a certain cell, facing one of the four neighbouring cells, and carries out t
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