Given $2018 \times 4$ grids and tint them with red and blue. So that each row and each column has the same number of red and blue grids, respectively. Suppose there're $M$ ways to tint the grids with the mentioned requirement. Determine $M \pmod {2018}$.
Solution?: Each column can be colored such as $$(R,R,B,B),(R,B,R,B),(R,B,B,R),$$$$(B,B,R,R),(B,R,B,R),(B,R,R,B)$$ Say the column colorings appears $a,b,c,a',b',c'$ respectively.
Clearly we must have $a+b+c= a'+b'+c'$ since $R$ appears the same times as $B$ in first row. Simillary we have $a+b'+c' = a'+b+c$ which implies $a=a'$. The same is true for $b=b'$ and $c=c'$. So we have that $a+b+c=1009$ and thus $$M =\sum_{a+b+c=1009}\frac{2018!}{a!^2b!^2c!^2} \equiv ?\pmod{2018}$$
Edit: after Ross Millikan answer.
My question here is: is this is correct and seeking for an alternative solution via generating functions.
As I read the problem this is not correct. Once you have $a,b,c$ which sum to $1009$ you still need to choose the $a$ columns of type $a$ etc. This gives $$\frac {2018!}{a!^2b!^2c!^2}$$ ways for each choice of $a,b,c$
Now argue that this is equivalent to $0 \pmod {2018}$ unless one of $a,b,c=1009$ because you have two extra factors of $1009$ in the numerator and plenty of $2$s as well, so we want $$3\frac{2018!}{1009!^2} \pmod {2018}$$