Given two integers a and b, find the smallest possible height such that a triangle of atleast area “a” and base “b” can be formed.
Input : a = 2, b = 2 Output : Minimum height of triangle is 2 Explanation: Input : a = 8, b = 4 Output : Minimum height of triangle is 4
Minimum height of Triangle with base “b” and area “a” can be evaluated by having the knowledge of the relationship between the three.
The relation between area, base and
area = (1/2) * base * height
So height can be calculated as :
height = (2 * area)/ base
Minimum height is the ceil of the
height obtained using above formula.
Minimum height is 4
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Find the height of a right-angled triangle whose area is X times its base
- Maximum height when coins are arranged in a triangle
- Area of Reuleaux Triangle
- Find the coordinates of a triangle whose Area = (S / 2)
- Area of Incircle of a Right Angled Triangle
- Check if right triangle possible from given area and hypotenuse
- Program to find area of a triangle
- Area of Circumcircle of a Right Angled Triangle
- Area of a triangle inside a parallelogram
- Area of a largest square fit in a right angle triangle
- Maximum area of triangle having different vertex colors
- Area of the Largest Triangle inscribed in a Hexagon
- Area of circle which is inscribed in equilateral triangle
- Find the altitude and area of an isosceles triangle
- Area of largest triangle that can be inscribed within a rectangle
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.
Improved By : vt_m