The sum of the areas of all triangles whose vertices are also vertices of a 1 by 1 by 1 cube is $m + \sqrt{n} + \sqrt{p},$ where $m, n,$ and $p$ are integers. Find $m + n + p.$
Triangles from cube vertices: $24$ in faces (legs $1,1$, area $\frac12$); $24$ with sides $1,\sqrt2,\sqrt3$ (area $\frac{\sqrt2}2$); $8$ equilateral with side $\sqrt2$ (area $\frac{\sqrt3}2$). Total $\binom83=56$.
Sum $12+12\sqrt2+4\sqrt3=12+\sqrt{288}+\sqrt{48}$.
The sum of the areas of all triangles whose vertices are also vertices of a 1 by 1 by 2 rectangular box is $m + \sqrt{n} + \sqrt{p},$ where $m, n,$ and $p$ are integers. Find $m + n + p.$