Problem

Source: Iran TST 2012-First exam-2nd day-P4

Tags: combinatorics proposed, combinatorics



Consider $m+1$ horizontal and $n+1$ vertical lines ($m,n\ge 4$) in the plane forming an $m\times n$ table. Cosider a closed path on the segments of this table such that it does not intersect itself and also it passes through all $(m-1)(n-1)$ interior vertices (each vertex is an intersection point of two lines) and it doesn't pass through any of outer vertices. Suppose $A$ is the number of vertices such that the path passes through them straight forward, $B$ number of the table squares that only their two opposite sides are used in the path, and $C$ number of the table squares that none of their sides is used in the path. Prove that \[A=B-C+m+n-1.\] Proposed by Ali Khezeli