Max Volume
Time limit1sMemory limit128 MB
Compute the volume of each cone, cylinder, and sphere with pi as 3.14159 and print the largest value rounded to three decimals.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Find the largest volume among the given three dimensional figures. There are three kinds of figures: a cone, a cylinder, and a sphere.

The volume of each figure comes from these formulas.
- Cone:
- Cylinder:
- Sphere:
Use in the calculation.
Input
The first line contains the number of figures (). Each of the next lines describes one figure. A cone starts with the letter C, followed by the radius and the height . A cylinder starts with the letter L, followed by the radius and the height . A sphere starts with the letter S, followed by the radius alone.
Output
Print the largest volume among the given figures, rounded to three decimal places. No volume in the input lands exactly on a rounding boundary.