Given the area of three faces of the rectangular parallelepiped which has a common vertex. Our task is to find the sum of lengths of all 12 edges of this parallelepiped.
In geometry, a parallelepiped is a three-dimensional figure formed by six parallelograms. By analogy, it relates to a parallelogram just as a cube relates to a square or as a cuboid to a rectangle. A picture of a rectangular parallelepiped is shown below.
Input: 1 1 1 Output: 12 Input: 20 10 50 Output: 68
Approach: The area given are s1, s2 and s3 . Let a, b and c be the lengths of the sides that have one common vertex. Where , , . It’s easy to find the length in terms of faces areas: , , . The answer will be the summation of all the 4 sides, there are four sides that have lengths equal to a, b and c.
In the first example the given area s1 = 1, s2 = 1 and s3 = 1. So with the above approach, the value of a, b, c will come out to be 1. So the sum of the length of all 12 edges will be 4 * 3 = 12.
Below is the implementation of the above approach:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Ways to Remove Edges from a Complete Graph to make Odd Edges
- Area of a Triangle from the given lengths of medians
- Reach the numbers by making jumps of two given lengths
- Split the array into odd number of segments of odd lengths
- Number of triangles possible with given lengths of sticks which are powers of 2
- Rectangular (or Pronic) Numbers
- Find the volume of rectangular right wedge
- Height of Pyramid formed with given Rectangular Box
- Maximum of smallest possible area that can get with exactly k cut of given rectangular
- Largest square which can be formed using given rectangular blocks
- Minimum sprinklers required to water a rectangular park
- Minimum number of square tiles required to fill the rectangular floor
- Minimum number of blocks required to form Hollow Rectangular Prism
- Maximum number of edges in Bipartite graph
- Number of Simple Graph with N Vertices and M Edges
- Find middle point segment from given segment lengths
- Number of edges in a perfect binary tree with N levels
- Program to find total number of edges in a Complete Graph
- Minimum edges to be added in a directed graph so that any node can be reachable from a given node
- Maximum number of edges that N-vertex graph can have such that graph is Triangle free | Mantel's Theorem
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.