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