I think I need a hint for how to get started. I mean, I know I need to find min and max for 2ab+2bc+2ac where abc=N. Just not sure how to do it programmatically.

# [Community puzzle] The max surface box

**Grokwik**#25

Holy sā¦t, my algo is passing all the tests (including the ones proposed here) except the 4th after submitting my code

Any hint someone ?

**Grokwik**#27

Hello

This case didnāt help, my algo was validating all the test cases, including the ones proposed in the forum, except the 4th after submiting.

I now have 100% but realized that I had to tweak a little bit: I compute using 2 different algorithm, and choose the best of both (which is obviously a dirty solution) but Iām too lazy to investigate further

Anyway thanks for the help !

**dubicube**#28

I was also passing all tests except the 4th until i code a probabilistic algorithm using random combinations of prime numbers from the decomposition of the input number and it worked perfectly xD

**Sylordis**#29

Iām passing all tests, but only the first validator does not passā¦ Does anyone knows what the validators are?

**Sylordis**#31

Haha, that was a stupid mistake on my behalfā¦ I forgot to check for low cubes numbers except 1. This is corrected now.

**PatFrrmth**#32

tests: 100% submit: 16% ā¦

now I got 87% but why is it so often the 1. test that I fail

**java_coffee_cup**#33

No need to think too much about prime factors. Just need to find all factors in integers, of a*b*c = N. Then check through all combinations for the max and min area. Brute force is still fast enough for this problem.

**TBali**#34

The puzzle is nice from coding or math point of view. (Though not belonging to āhardā category, especially because it is simply brute-forceable).

But have you ever tried to build a bigger block from ONLY 1x1x1 size LEGO blocks?? If you donāt have anything that holds the adjacent small blocks together, it will fall apart, so if using only 1x1x1 blocks, the ONLY solution that would pass a HARDWARE validator is 1x1xNā¦