I am not getting this type of problem.

The question is: A soup can in the shape of a right circular cylinder of radius r and height h is to have a prescribed volume V. The top and bottom are cut from squares as shown in the figure (the figure is a circle inscribed in a square). If the shaded corners (the corners of the square outside of the circle) are wasted, but there is no other waste, find the ratio r/h for the can requiring the least material, including waste.

In my book, it has steps for solving these problems. It says to draw a picture, then find a formula for the quantity to be maximized or minimized. Then using the conditions stated in the problem to eliminate variables, express the quantity as a function of one variable. Then find the interval of possible values from physical restrictions and solve.

I know the formulas for volume and surface area of a cylinder: V= h and S=2 rh (that is the equation for surface area, right?). But I'm not sure exactly how to use them here.

I know you need to get an equation with one variable in it, either r or h, and then take the derivative, but I don't know how r and h relate to each other in this problem.

help please