10. Let $M$ be a point on the plane with coordinates $(p \times 1994, 7 p \times 1994)$, where $p$ is a prime number. Find the number of right triangles that satisfy the following conditions:
(1) The three vertices of the triangle are integer points, and $M$ is the right-angle vertex;
(2) The incenter of the triangle is the origin of the coordinates.
10. Solution: Connect the origin $O$ and point $M$, and take the midpoint $I(P \times 997, 7P \times 997)$ of the line segment $OM$. Perform a central symmetry transformation about point $I$, which transforms point $(x, y)$ into point $(P \times 1994 - x, 7P \times 1994 - y)$. Thus, a right triangle that satisfies the conditions is transformed into a congruent right triangle with integer coordinates, with the incenter moving to point $M$ and the right-angle vertex moving to the origin. Therefore, the number of integer-coordinate right triangles that satisfy the conditions can be considered by only looking at the case where the right-angle vertex is at the origin and the incenter is at point $M$.

Consider an integer-coordinate right triangle $\triangle OAB$ (as shown in the figure). Let $\angle xOM = \beta$, $\angle xOA = \alpha$, and $\alpha + \frac{\pi}{4} = \beta$. From the problem conditions, $\tan \beta = 7$, and $\tan \alpha = \tan \left(\beta - \frac{\pi}{4}\right) = \frac{\tan \beta - 1}{1 + \tan \beta} = \frac{3}{4}$. Therefore, any point on the leg $OA$ can be written as $(4t, 3t)$, and since $A$ is an integer point, we can set $A(4t, 3t) \left(t \in \mathbf{N}_{+}\right)$, so $|OA| = 5t$. From $\angle yOB = \alpha$, we can set the coordinates of $B$ as $\left(-3t', 4t'\right) \left(t' \in \mathbf{N}_{+}\right)$, so $|OB| = 5t'$. The inradius of the right triangle is $r = \frac{\sqrt{2}}{2}|OM| = 5P \times 1994$.

Let $|OA| = 2r + p'$ and $|OB| = 2r + q'$. Since $|OA|$, $|OB|$, and $r$ are all multiples of 5, the positive integers $p'$ and $q'$ are also multiples of 5. Using the property that the lengths of the tangents from a point outside a circle to the circle are equal, we have $|AB| = (r + p') + (r + q') = 2r + p' + q'$. Since $\triangle$ is a right triangle, we have
\[
0 = AB^2 - OA^2 - OB^2 = (2r + p' + q')^2 - (2r + p')^2 - (2r + q')^2 = 2p'q' - 4r^2
\]
which gives $p'q' = r^2$.
Since $\frac{p'}{5}, \frac{q'}{5} \in \mathbf{N}_{+}$, we have $\frac{p'}{5} \cdot \frac{q'}{5} = 2^3 \times 997^2 \times p^2$.
When $p \neq 2$ and $p \neq 997$, we have $\frac{p'}{5} = 2^i \times 997^j \times p^k$ and $\frac{q'}{5} = 2^{3-i} \times 997^{2-j} \times p^{2-k}$, where $i = 0, 1, 2, 3; j = 0, 1, 2; k = 0, 1, 2$. Thus, $\left(\frac{p'}{5}, \frac{q'}{5}\right)$ has $4 \times 3 \times 3 = 36$ different (ordered) solutions. Similarly, when $p = 2$, $\left(\frac{p'}{5}, \frac{q'}{5}\right)$ has $6 \times 3 = 18$ different (ordered) solutions. When $p = 997$, the equation has $4 \times 5 = 20$ different (ordered) solutions.
Therefore, the number of right triangles that satisfy the conditions is
\[
S = \left\{\begin{array}{ll}
36 & \text{when } p \neq 2 \text{ and } p \neq 997, \\
18 & \text{when } p = 2, \\
20 & \text{when } p = 997.
\end{array}\right.
\]