← All problemsSign in

Save People

CodeChefRating 1750Open on judge ↗

Chef has a $2$-D grid with $N$ rows and $M$ columns. The cell at the intersection of the $i$-th row and $j$-th column is denoted cell $(i, j)$. Initially, *only* cell $(x, y)$ of the grid is infected. Chef can select **exactly one** non-infected cell and *vaccinate* it. Then, the infection and the vaccine spread across the grid, as follows: - First, any cell that is neither vaccinated nor infecte

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