GAUSS8 2023 Problem 20

A 4 \times 4 grid is to be covered with 16 square tiles. There are four tiles in each of the colours red, black, green, and yellow. Each row must contain one tile of each colour. Each pair of tiles that touch along a side or at a corner must have different colours. In how many different ways can these tiles be arranged?

Answer Choices
A. 256
B. 24
C. 120
D. 576
E. 64