19. The numbers $2,3,4,5,6,7,8$ are to be placed, one per square, in the diagram shown so that the sum of the four numbers in the horizontal row equals 21 and the sum of the four numbers in the vertical column also equals 21 . In how many different ways can this be done?

A 0
B 2
C 36
D 48
E 72
Solution: $\mathbf{E}$
Let the numbers in the squares be $t, u, v, w, x, y$ and $z$, as shown. We have $(w+x+y+z)+(t+u+x+v)=21+21=42$, that is $(t+u+v+w+x+y+z)+x=42$. But $t+u+v+w+x+y+z=$ $2+3+4+5+6+7+8=35$ and hence $x=7$. So $t, u, v$ are three numbers chosen from 2, 3, 4, 5, 6, 8 which add up to 14 . It can be checked that there are just two choices for these numbers $2,4,8$ and $3,5,6$. If the numbers in the horizontal row are 2 4,8 and 7, there are 3 choices for $w$ and then 2 choices for $y$ and then 1 choice for $z$, making $3 \times 2 \times 1$ choices altogether, and then similarly 6 choices for $t, u, v$, making $6 \times 6=36$ combinations. Likewise there are 36 combinations where the numbers in the horizontal row are 3,5,6 and 7. This makes $36+36=72$ different ways altogether.