Maximizing the volume of a rectangular prism A rectangular prism has a surface area of $300$ square inches.  What whole number dimensions give the prism the greatest volume?
This is a math olympiad problem. It involves the volume and surface area of a prism.
Please, find a good solution.
Thank You!
 A: If we are assuming a fully rectangular prism---right angles all around---then there actually are only two candidates: $(h,w,l)=(20,5,2)$ and $(h,w,l)=(12,9,2)$. The former has a volume of 200, the latter has a volume of 216. So $(12,9,2)$ it is.
I solved this by exhaustive search. Here's my very dumb MATLAB code. Certainly it's not the most efficient but sometimes life calls for quick and dirty solutions. At least I limit the loops to 75, since the largest single dimension to achieve a surface area of 300 has to be less than that: $(75,1,1)$ gives us a surface area of 302:
for h = 1 : 75,
    for w = 1 : h,
        for l = 1 : w,
            if 2*(h*w+h*l+w*l) == 300,
                [h,w,l,h*w*l]
            end
        end
    end
end

So how would you do this without code? Well, I'd probably begin an exhaustive search, frankly, but with some efficiency. Let's rewrite the surface area formula as follows:
$$2(hw+hl+wl)=300 \quad\Longrightarrow\quad hw+l(w+h)=150
\quad\Longrightarrow\quad (h+l)(w+l)=150+l^2$$
So for a fixed value of $l$, $150+l^2$ must admit an integral factorization $pq$ with $p,q>l$.


*

*Consider $l=1$: we have $pq=151$. Since 151 is prime, so there are no
solutions. Continuing: 

*$l=2$, $pq=154$, prime factors 2, 7, and 11.
Since $p,q>2$, our choices are $(p,q)\in\{(22,7),(14,11)\}$ or
$(h,w,l)\in\{(20,5,2),(12,9,2)\}$. These are the two answers we found
above. 

*$l=3$: $pq=159$, prime factors 3 and 53; since $p,q>3$, there
are no solutions. 

*$l=4$: $pq=166$, prime factors 2 and 83; no
solutions with $p,q>4$.

*$l=5$: $pq=175$, factors 5, 5, and 7. The only solution
with $p,q>5$ is $(p,q)=(25,7)$, which gives us $(h,w,l)=(20,2,5)$, a
permutation of our previous solution (and not even the optimal one, at that!). 

*$l=6$: $pq=186$, factors 2, 3,
31; no solutions with $p,q>6$. 

*$l=7$: $pq=199$, prime, no solutions.


I could continue, but since this is a contest problem I probably would have taken a chance on $(12,9,2)$ pretty much as soon as I acquired it. Even if I had time I doubt I would have bothered to proceed past $l=4$ or $l=5$.
A: From various sources, https://math.dartmouth.edu/archive/m8f02/public_html/pauls_mws/boxeg.pdf
http://www.leadinglesson.com/problem-on-finding-the-rectangular-prism-of-maximal-volume
I confirmed that to obtain the max volume, the prism would be a cube.
So in this case, we would try to find the volume assuming that the prism is a cube.
1 Face of the cube would be 300/6=50
1 Side of the cube would be √50≈7.07
The volume would be 7.07 * 50 = 353.5 

I know this answer is late, I found this because I was trying to find the answer to my homework. I am just a student in grade 8 so please correct me if I'm wrong.
