Let the rectangular block have dimensions x, x and y. (2 x's because the cross section is a square).
So the surface area is given be (each end face) (each length face).
Volume = 'area of cross section' times 'length' = .
Once you have calculated this value, substitute into the equation for y. Use the Volume = formula to find the max volume.