Finding unique cubiods with given volume I have an interval of intigers and I need to find all unique cuboids which have volume that falls within said interval.

I came up with a loop that goes over all uniqe combinations of 3 numbers (size of the cuboid) (1x1x1, 1x1x2, ...; also 2x1x1 is considered the same as 1x1x2) from 1 to the upper range of the interval. And then checks if the calculated volume falls within the interval. This solution works perfectly if the upper range isnt is too large. But if the interval ends in thousands the solution becomes very slow.

I am not really interested in code as I am in an algorithm on how to solve this differently. How would you go on about solving this?
Hint. Once you've chosen the first two dimensions, it's trivial to calculate what (if any) range of values for the third dimension give a volume within your interval.