DMOPC '14 Contest 5 P1 - Core Drill

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Simon got a new drill recently. Everyone knows that a drill is shaped like a right circular cone. Simon knows his drill has radius r and height h. But now he wants to calculate the volume. Write a program to help Simon!

Input Specification

The first line of input will have an integer r (1 \le r \le 100).

The second line of input will have an integer h (1 \le h \le 100).

Output Specification

The first line of output should have the volume of Simon's drill. The output will be accepted if it's within an absolute or relative error of 10^{-2}.

Sample Input

3
5

Sample Output

47.12

Hint

V is the volume of the right circular cone with radius r and height h.

V=\dfrac{\pi r^2h}{3}


Comments


  • 0
    PhoenixCoolIce  commented on April 24, 2024, 5:58 p.m.

    Apparently you don't need to round to two digits?


  • 1
    22KamilMazur  commented on Feb. 28, 2024, 1:59 p.m. edited

    this one was difficult :(


  • -3
    Thousand201107  commented on Jan. 7, 2024, 10:31 a.m.

    I tried that pi must be 22/7in py3


  • -3
    Viv_CCGS  commented on Dec. 31, 2023, 12:32 p.m.

    Apparently 22/7 and 3.14 both work as approximations of pi...


  • -2
    JoJo_Cubano_13  commented on Dec. 31, 2023, 4:41 a.m. edit 2
    #define pi acos(-1)
    

    if you have problems with this value


  • 1
    HashDev  commented on Jan. 9, 2022, 9:23 p.m. edited

    Don't worry about decimal numbers in PI

    PI = 3.141592653589793 & PI = 3.14 - Worked Fine


  • -2
    candyappled  commented on Sept. 22, 2021, 6:06 p.m.

    You need to use the iomanip library if working in C++. Using 3.14 as pi is fine, just make sure to declare the variables in the order they appear otherwise DMOJ might interpret it as incorrect.


  • -2
    SagarSaha  commented on July 4, 2020, 3:27 a.m.

    What is the value of π? I know it is 3.14159...

    but will i round it off to 3.14?


    • 4
      AlanL  commented on July 4, 2020, 4:06 p.m. edit 3

      If you read the output specification, it says in what cases your output will be accepted. In this case, it is fine to use 3.14 as π. If you have more questions, it would be easier to join the DMOJ Discord to get faster responses instead of commenting on each problem.

      Admin Edit: fixed to become reply :)