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 r – radius of lower base and s – slant 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.
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
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
Editorial