Largest Volume
Practice
3.4 (876 votes)
Ternary search
Medium
Problem
7% Success 3118 Attempts 30 Points 1s Time Limit 64MB Memory 1024 KB Max Code

Now our heroes - Maga and Alex are working for Oil Company as developers. Recently they have faced a great problem.

They couldn’t find the correct solution. Could you help them?

We are given rradius of lower base and sslant height. The figure can be cylinder or truncated cone. You have to find as largest volume as possible to carry oil respect to given information. The slant height is the shortest possible distance between the edges of two bases through surface of cone.

enter image description here enter image description here enter image description here

Input :

You are given 2 numbers. r– radius of lower base and s – slant height.

Output:

Largest Volume. Print 2 digits after floating point.

Constraints:

1 <= r, s <= 100

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
6 votes
Tags:
ImplementationBasic ProgrammingAd-HocEasyMathematicsOpenApprovedMathamatics
Points:30
Tags:
Special NumbersMediumTernary SearchSearchingAlgorithmsCountingMath
Points:30
Tags:
AlgorithmsGame TheoryMedium