7. $(5-7,8,9)$ a) In a $3 \times 4$ table, numbers from 1 to 12 need to be arranged such that the difference between any two numbers in the same row is divisible by 3, and the difference between any two numbers in the same column is divisible by 4. An example of such an arrangement is:

| 1 | 4 | 7 | 10 |
| :---: | :---: | :---: | :---: |
| 5 | 8 | 11 | 2 |
| 9 | 12 | 3 | 6 |

In how many ways can this be done? b) Can the numbers from 1 to 24 be arranged in a $6 \times 4$ table such that the difference between any two numbers in the same row is divisible by 6, and the difference between any two numbers in the same column is divisible by 4?
Answer: a) $144=3!\cdot 4!$; b) No.

Solution: a) Each column can be associated with a remainder of division by 4, and each row with a remainder of division by 3. Considering all possible permutations of remainders of division by 3 and by 4, we get $3!\cdot 4!=144$. b) Suppose such a table exists. We associate rows with remainders of division by 6 and columns with remainders of division by 4. Then at the intersection of the row with remainder 0 and the column with remainder 1, no number can stand (it must be even and odd at the same time).