Tom needs to make a rectangular box for his physics class project. He has bought P cm of wire and S (cm*cm) of special paper. He would like to use all the wire (for the 12 edges) and paper (for the 6 sides) to make the box.
Print a real number that is the largest volume of the box that Tom can make, rounded to two decimal places.
Sample Input 1:
20 14
Sample Output 1:
3.00
Output details: the dimensions of the largest box may be 3, 1 and 1.
Sample Input 1:
20 16
Sample Output 2:
4.15
Output details: the dimensions of the largest box may be 7/3, 4/3 and 4/3.

No comments:
Post a Comment