Problem

Source: Bulgaria 1992 P3

Tags: combinatorics, number theory, geometry, algebra, Sequences



Let $m$ and $n$ are fixed natural numbers and $Oxy$ is a coordinate system in the plane. Find the total count of all possible situations of $n+m-1$ points $P_1(x_1,y_1),P_2(x_2,y_2),\ldots,P_{n+m-1}(x_{n+m-1},y_{n+m-1})$ in the plane for which the following conditions are satisfied: (i) The numbers $x_i$ and $y_i~(i=1,2,\ldots,n+m-1)$ are integers and $1\le x_i\le n,1\le y_i\le m$. (ii) Every one of the numbers $1,2,\ldots,n$ can be found in the sequence $x_1,x_2,\ldots,x_{n+m-1}$ and every one of the numbers $1,2,\ldots,m$ can be found in the sequence $y_1,y_2,\ldots,y_{n+m-1}$. (iii) For every $i=1,2,\ldots,n+m-2$ the line $P_iP_{i+1}$ is parallel to one of the coordinate axes. (Ivan Gochev, Hristo Minchev)