MathDB
pawn can be moved from (x,y) to (x',y') iff |x - x'| = p and |y- y'| = q

Source: Austrian - Polish 1997 APMC

May 3, 2020
combinatorics

Problem Statement

Each square of an n×mn \times m board is assigned a pair of coordinates (x,y)(x,y) with 1xm1 \le x \le m and 1yn1 \le y \le n. Let pp and qq be positive integers. A pawn can be moved from the square (x,y)(x,y) to (x,y)(x',y') if and only if xx=p|x - x'| = p and yy=q|y- y'| = q. There is a pawn on each square. We want to move each pawn at the same time so that no two pawns are moved onto the same square. In how many ways can this be done?