Given the length, breadth, and height of a cuboid, the task is to find the length of the longest rod that can fit in a cuboid.
Input: length = 12, breadth = 9, height = 8 Output: 17 Input: length = 22, breadth = 19, height = 8 Output: 30.1496
Explanation: In the figure
GH = length, GF = breadth, FB= height
The length of the longest rod is BH. Therefore to compute BH we can apply Pythagoras Theorem in Triangle BHF. From triangle HGF we can compute the length of FH.
After getting the length of FH we can find the length of BH using Pythagoras theorem in triangle BHF.
Below is the implementation of the above approach:
- Percentage increase in the volume of cuboid if length, breadth and height are increased by fixed percentages
- Length of the longest substring with no consecutive same letters
- Find length of longest Fibonacci like subsequence
- Length of longest sub-array with maximum arithmetic mean.
- Length of the longest increasing subsequence such that no two adjacent elements are coprime
- Maximize volume of cuboid with given sum of sides
- Divide cuboid into cubes such that sum of volumes is maximum
- Program for Volume and Surface Area of Cuboid
- Find maximum volume of a cuboid from the given perimeter and area
- Python | Percentage increase in the total surface area of the cuboid
- Program to find Length of Bridge using Speed and Length of Train
- Length of the chord the circle if length of the another chord which is equally inclined through the diameter is given
- Longest subsequence with a given AND value
- Longest sub-sequence with minimum LCM
- Longest sub-array whose product is 0
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.