Explanation of the explanation
It took me quite some time to see the connection of the two problems even with 6700417 's illustration. So I will explain it a bit more.
If the diagonal has equation y=(n/m)x or x=(m/n)y.
The last two inequalities are equivalent to X<(m/n)Y+1 and Y<(n/m)X+1. Let (X,Y) be a pair of such positive integers.
Case 1: (X,Y) is above the diagonal (i.e. Y>(n/m)X). The point (X, (n/m)X) (on the diagonal) is on the right edge of the unit square with (X,Y) as the upper right vertex.
Case 2: (X.Y) is below the diagonal (i.e. Y<(n/m)X, X>(m/n)Y). The point ((m/n)Y, Y) (on the diagonal) is on the top edge of the unit square with (X,Y) as the upper right vertex.
Case 3: (X,Y) is on the diagonal. The diagonal crosses the unit square with (X,Y) as the upper right vertex.
In any case, if (X,Y) is a solution for the system of inequalities, the diagonal will cross the unit square with (X,Y) as the upper right vertex.
Conversely, we can argue that if the diagonal crosses a unit square, the upper right vertex of the square is a solution of our system of inequalities.