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
- 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
- Check if right triangle possible from given area and hypotenuse
- Area of Incircle of a Right Angled Triangle
- Area of a triangle inside a parallelogram
- Area of Circumcircle of a Right Angled Triangle
- Program to find area of a triangle
- Area of a largest square fit in a right angle triangle
- Maximum area of triangle having different vertex colors
- Area of circle which is inscribed in equilateral triangle
- Find the altitude and area of an isosceles triangle
- Area of the Largest Triangle inscribed in a Hexagon
- Area of largest triangle that can be inscribed within a rectangle
- Program to calculate area and perimeter of equilateral triangle
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