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