MathDB
Moving pieces in a lattice

Source: 2022 China TST, Test 1, P3 (posting for better LaTeX)

March 24, 2022
combinatoricsinvariantalgorithm

Problem Statement

Let a,b,c,p,q,ra, b, c, p, q, r be positive integers with p,q,r2p, q, r \ge 2. Denote Q={(x,y,z)Z3:0xa,0yb,0zc}.Q=\{(x, y, z)\in \mathbb{Z}^3 : 0 \le x \le a, 0 \le y \le b , 0 \le z \le c \}. Initially, some pieces are put on the each point in QQ, with a total of MM pieces. Then, one can perform the following three types of operations repeatedly: (1) Remove pp pieces on (x,y,z)(x, y, z) and place a piece on (x1,y,z)(x-1, y, z) ; (2) Remove qq pieces on (x,y,z)(x, y, z) and place a piece on (x,y1,z)(x, y-1, z) ; (3) Remove rr pieces on (x,y,z)(x, y, z) and place a piece on (x,y,z1)(x, y, z-1).
Find the smallest positive integer MM such that one can always perform a sequence of operations, making a piece placed on (0,0,0)(0,0,0), no matter how the pieces are distributed initially.