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?
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