Let the base be m and height be n. I am assuming the problem indicates square base is used.

Assuming the box has an open top, the surface area is

Solve for n from the surface area, then plug the expressions into the volume formula.

Find the first derivative of volume:

Then solve for m.

The story changes if this is a closed top box.