This project will give you the radius and the height of the cheapest cilinder you can make that can hold the volume you input. The h stands for height and the r stands for radius. This is done using calculus. Here you can see what's happening: https://www.youtube.com/watch?v=PsWsvFxwT70&t=2s I have done the generalization so you can apply this to every possible volume within the bounds. With cheapest I mean the lowest area, which logically cost the least amount of money.
Thanks to Zach star to introduce me to this problem: https://www.youtube.com/channel/UCpCSAcbqs-sjEVfk_hMfY9w I can't remember the video where I saw it, but I know he introduced me to the problem.