To minimize surface area of integer cuboid of ​the known volume

1.7k Views Asked by At

There is a cuboid (a * b * c), (a, b, c ∈ N), whose side lengths are all integers.

S (Surface area of a cuboid) = 2 * (ab + bc + ca).

V (Volume of a cuboid) = a * b * c = n.

I need to minimize S, provided that I specified the volume (V).

Is there some algorithm or way to get a, b, c, excepted a brute force?

1

There are 1 best solutions below

0
On

It is optimized version of naive algorithm (I hope that it will help). Unfortunately I don't know fastest algorithm:

https://github.com/LmTinyToon/Puzzles/blob/master/CodingGame/Community/the-max-surface-box.cpp