Computing areas P39057


Statement
 

pdf   zip

thehtml

Write a program that reads several descriptions of rectangles and circles, and for each one prints its corresponding area.

Input

Input begins with a number n, followed by n descriptions. If of a rectangle, we have the word “rectangle” followed by two strictly positive real numbers: its length and its width. If of a circle, we have the word “circle” followed by a strictly positive real number: its radius.

Output

For each description, print its area with 6 digits after the decimal point.

Public test cases
  • Input

    2
    rectangle 10 2.5
    circle 100
    

    Output

    25.000000
    31415.926536
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Salvador Roura
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Pascal Python
    User solutions
    C C++ Java Python Rust