Problem:
A $150\times 400\times 660$ rectangular prism is cut into $39600000$ $1\times 1\times 1$ cubes. An internal diagonal of the prism passes through how many of the $1\times 1\times 1$ cubes?
Insight:
Instead of looking at a $150\times 400\times 660$ rectangular prism, I looked at a
$$ \dfrac{150}{\gcd(150,400,660)} \times \dfrac{400}{\gcd(150,400,660)} \times \dfrac{660}{\gcd(150,400,660)} \implies 15\times 40\times 66$$ rectangular prism. However, these numbers were still too large to compute the problem manually. Are there any elegant solutions to this problem? I also tried putting the prism on the $xyz$ plane, but that got me nowhere as well. Any help is appreciated!