An examination hall contains $r\times c$ chairs. These chairs are arranged in $r$ rows and $c$ columns. Let $P_{i,j}$ be the position of the chair that is in the $i^\text{th}$ row and the $j^\text{th}$ column in that hall. There are $r \times c$ students have to attend an exam so that no two nearby students have the same exam form. For instance, the form with the student who sits on $P_{1,1}$ has to be different from the forms with the students who sit on $P_{1,2},P_{2,1},P_{2,2}$. Similarly, the form with the student who sits on $P_{4,6}$ has to be different from the forms with the students who sit on $P_{3,5},P_{3,6},P_{3,7},P_{4,5},P_{4,7},P_{5,5},P_{5,6},P_{5,7}$. Another example is that the form with the student who sits on $P_{r-1,c}$ has to be different from the forms with the students who sit on $P_{r-2,c-1},P_{r-2,c},P_{r-1,c-1},P_{r,c-1},P_{r,c}$.
Knowing $r$ and $c$, what is the minimum number of the exam forms?
Assuming $r>1,c>1$, consider a $2\times2$ square of neighboring sits. The 4 students sitting in these sits shall obtain different forms. Thus, the number of forms $N\ge4$. On the other hand since a simple alternating distribution of the forms: $$ \dots121212\dots\\ \dots343434\dots\\ \dots121212\dots\\ \dots343434\dots $$ completely suffices, the answer is $N=4$.