Suppose we have a cuboid with dimensions $A\times B\times C$ composed of $1\times 1\times 1$ cubes with $\gcd(A,B)=gcd(A,C)=gcd(B,C)=1$.
Considering any vertex of the cuboid as origin, say $O$, we select $3$ vertices $P$,$Q$ and $R$ such that $OP$, $OQ$ and $OR$ are mutually perpendicular. If we cut the cuboid along the plane $PQR$ in two parts, how many $1\times 1\times 1$ cubes will be cut?
I have till now solved the problem in $2D$ system with a line slicing an $A\times B$ rectangle through the diagonal. In that case the answer turns out to be $A+B-1$. With similar logic I established that any needle through the diagonal of cuboid will pierce through $A+B+C-2$ cubes (correct me if I'm incorrect). But I could not wrap my head around the cuboid and plane problem.
