Let $a$, $b$, $p$, and $q$ be fixed positive integers. If an $a\times b$ grid can be tiled using some $1\times p$ and $q\times 1$ pieces, show that either $a$ is divisible by $p$ or $b$ is divisible by $q$. Here, a $1\times k$ and $k\times 1$ grids are treated as different.
If either $x=1$ or $y=1$, the conclusion plainly holds because $1$ can divide any positive integer. So, it is left to prove the claim when $x\ne 1$ and $y\ne 1$.
Let cell $(i, j)$ be represented by $x^iy^j$. Then the sum of all cells in a $1\times p$ grid whose leftmost cell locates $(i,j)$ equals $$x^iy^j + x^{i+1}y^j + \cdots + x^{i+p-1}y^j = x^iy^j\sum_{k=0}^{p-1}x^k$$
Similarly, the sum of a $q\times 1$ piece whose topmost cell locates at $(i, j)$ equals $$x^iy^j + x^i y^{j+1}+x^iy^{j+q-1}=x^iy^j\sum_{k=0}^{q-1}y^k$$
Let $x\ne 1$ be a complex root to the equation $x^p=1$ and $y\ne 1$ be a complex root to the equation $y^q=1$. Then, both sums above will equal $0$.
It follows that if one $a\times b$ grid can be titled by some $1\times p$ and $q\times 1$ pieces, the sum of all cells must equal $0$ because every piece's sum is $0$. This means $$0=\sum_{j=1}^{a}\sum_{k=1}^{b}x^jy^k=xy\frac{(1-x^a)(1-y^b)}{(1-x)(1-y)}$$
$$\therefore\quad (1-x^a)(1-y^b)=0\implies x^a=1\quad\text{or}\quad y^b=1$$
Because $x$ is a root to $x^p=1$ and $y$ is a root to $y^q=1$, thus either $a$ is a multiple of $p$ or $b$ is a multiple of $q$.