Here are some ideas to get you started.
Let x = the height of a locker. Let y = the width.
Then the area of one locker will be A = xy.
The trick is to come up with a relationship between x and y so that A can be written as the function of one variable.
Since there are 99 meters of lumber available we want to determine how many "x"es and how many "y"s are required to build the 80 lockers. Draw a sketch of several adjoining lockers to get the idea. Let's say there are only 3 lockers. Then there will be six (6) widths, but there will be four (4) heights--because of the common walls. Extrapolate this out to 80 lockers.
The amount of lumber used must total 99. Solve for y in terms of x and substitute into the A = xy formula.
Find A', set it equal to zero and solve for x (critical number for the function). Does that value produce a max of or min? You can use 2nd derivative test (or similar), or note that the function A(x) is a downward opening parabola, so the y-value of the vertex is a max.