$37 \cdot 9$ In the $xy$ plane, the vertices of a triangle have coordinates $(x, y)$, where $x, y$ are integers, and satisfy $1 \leqslant x \leqslant 4,1 \leqslant y \leqslant 4$. The number of such triangles is
(A) 496.
(B) 500.
(C) 512.
(D) 516.
(E) 560.
(44th American High School Mathematics Examination, 1993)
[ Sol] In the $xy$-plane, there are 16 integer points that satisfy the conditions: $1 \leqslant x \leqslant 4, 1 \leqslant y \leqslant 4$. Therefore, there are $C_{16}^{3}=560$ sets of three points. We need to subtract the sets of three collinear points from this total.

There are 4 vertical lines and 4 horizontal lines on the plane, each containing 4 points. These 8 lines contain $8 C_{4}^{3}=32$ sets of three collinear points. Similarly, the number of sets of three collinear points on a line with a slope of $\pm 1$ is
$$
2 C_{4}^{3}+4 C_{3}^{3}=8+4=12 \text{. }
$$

There are no other sets of three collinear points.
Thus, the number of triangles formed is
$$
560-32-12=516 \text{. }
$$

Therefore, the answer is (D).