The vertices of a $3 \times 1 \times 1$ rectangular prism are $A, B, C, D, E, F, G$, and $H$ so that $A E, B F$, $C G$, and $D H$ are edges of length 3. Point $I$ and point $J$ are on $A E$ so that $A I=I J=J E=1$. Similarly, points $K$ and $L$ are on $B F$ so that $B K=K L=L F=1$, points $M$ and $N$ are on $C G$ so that $C M=M N=N G=1$, and points $O$ and $P$ are on $D H$ so that $D O=O P=P H=1$. For every pair of the 16 points $A$ through $P$, Maria computes the distance between them and lists the 120 distances. How many of these 120 distances are equal to $\sqrt{2}$ ?

![](https://cdn.mathpix.com/cropped/2024_04_17_b6707dc71c8b7ccd30afg-3.jpg?height=374&width=677&top_left_y=905&top_left_x=781)
The distance from point $A$ to each of points $B, D$, and $I$ is 1 .

Since $A B C D$ is a square of side length 1, the Pythagorean theorem implies that the distance from $A$ to $C$ is $\sqrt{1^{2}+1^{2}}=\sqrt{2}$.

A similar calculation shows that the distance from $A$ to $K$ is $\sqrt{2}$ and the distance from $A$ to $O$ is $\sqrt{2}$.

To compute the distance from $A$ to $M$, observe that $\triangle A O M$ is right-angled at $O$ with $O M=1$, so the distance from $A$ to $M$ is $\sqrt{A O^{2}+O M^{2}}=\sqrt{2+1}=\sqrt{3}$.

The distance from $A$ to $J$ is 2 which is greater than $\sqrt{2}$.

Notice that $J$ is the closest point to $A$ among the points $J, L, N, P, E, F, G$, and $H$, so none of these points can be a distance of $\sqrt{2}$ from $A$.

Therefore, the points that are at a distance of $\sqrt{2}$ from $A$ are $C, K$, and $O$, for a total of 3 .

By symmetry, there will be a total of 3 points at a distance of $\sqrt{2}$ from each of $B, C, D, E, F$, $G$, and $H$.

Next consider point $K$. By reasoning similar to that which is above, each of $E, F, G$, and $H$ has a distance of at least $2>\sqrt{2}$ from $K$.

Applications of the Pythagorean theorem can be used to show that the points that are $\sqrt{2}$ away from $K$ are $A, C, O, N$, and $J$, for a total of 5 points.

By symmetry, there are a total of 5 points at a distance of $\sqrt{2}$ from each of $I, J, L, M, N, O$, and $P$.

We have counted 3 points at a distance of $\sqrt{2}$ from each of the 8 points $A$ through $H$, and 5 points at a distance of $\sqrt{2}$ from each of the 8 points from $I$ through $P$.

This is a total of $8 \times 3+8 \times 5=64$.

The lengths of the line segments were counted once for each end point, which means the total of 64 counts every distance of $\sqrt{2}$ twice.

Therefore, the answer is $\frac{64}{2}=32$.

ANSWER: 32