[ Rectangular parallelepipeds ] [ Pythagorean theorem in space ] The diagonals of three different faces of a rectangular parallelepiped are $m$, $n$, and $p$. Find the diagonal of the parallelepiped.
Let $x, y$ and $z$ be the dimensions of a given rectangular parallelepiped, and $d$ be its diagonal. Then

$$
x 2+y 2=m 2, x 2+z 2=n 2, y 2+z 2=p 2
$$

By adding these equations term by term, we get

$$
2 x 2+2 y 2+2 z 2=m 2+n 2+p 2
$$

Therefore,

$$
d=\sqrt{x^{2}+y^{2}+z^{2}}=\sqrt{\frac{m^{2}+n^{2}+p^{2}}{2}}
$$

Answer

$$
\sqrt{\frac{m^{2}+n^{2}+p^{2}}{2}}
$$