This page is still under construction.

Parts of this page are still being built. What you see may change.

Max Volume

Time limit1sMemory limit128 MB

Summary
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 VV of each figure comes from these formulas.

  • Cone: V=13πr2hV = \frac{1}{3} \pi r^2 h
  • Cylinder: V=πr2hV = \pi r^2 h
  • Sphere: V=43πr3V = \frac{4}{3} \pi r^3

Use π=3.14159\pi = 3.14159 in the calculation.

Input

The first line contains the number of figures nn (1≤n≤1001 \le n \le 100). Each of the next nn lines describes one figure. A cone starts with the letter C, followed by the radius rr and the height hh. A cylinder starts with the letter L, followed by the radius rr and the height hh. A sphere starts with the letter S, followed by the radius rr 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.

Examples2

  1. Example 1

    Input
    5
    S 3.0
    C 2.5 3
    S 1.79
    L 2.78 1.4
    C 1.15 2.36
    
    Expected output
    113.097
    
  2. Example 2

    Input
    3
    C 10 10
    L 5 12
    S 6
    
    Expected output
    1047.197