Ուղարկել | Բոլոր լուծումները | Լավագույն լուծումները | Վերադառնալ ցուցակին |
ACM_0113 - MAX VOLUME |
Write a program to find the maximum volume of given geometric 3-dimensional figures. Here, there are 3 types of figures: cone, cylinder and sphere.
The volume (V) of each figure can be calculated by the following formulas. Cone: V = (1/3)πr2h
Cylinder: V = πr2h Sphere: V = (4/3)πr3
Use the value π = 3.14159 in your calculation.
Input
The first line of the input contains a positive integer n (1<=n<=100) which is the number of figures. The n following lines contain the description of each figure. In case of a cone, the line begins with letter C and followed by 2 values: r and h respectively. If it is a cylinder, the line begins with letter L and followed by 2 values: r and h respectively. If it is a sphere, the line begins with letter S and followed by only one value which is r.
Output
Print out the max volume among the input figures with 3 decimal places
Examples
№ |
stdin |
stdout |
1 |
5 S 3.0 C 2.5 3 S 1.79 L 2.78 1.4 C 1.15 2.36 |
113.097 |
Ավելացրեց. | Հրանտ Հովհաննիսյան |
Ամսաթիվ. | 2014-02-01 |
Ժամանակի սահմանափակումը. | 1s |
Ծրագրի տեքստի սահմանափակումը. | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Լեզուներ. | Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE |
Աղբյուրը. | Thailand Southern 2013.C |