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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find the height of a right-angled triangle whose area is X times its base
- Find the Nth digit from right in base B of the given number in Decimal base
- Given a number N in decimal base, find the sum of digits in any base B
- Count of Right-Angled Triangle formed from given N points whose base or perpendicular are parallel to X or Y axis
- Find all sides of a right angled triangle from given hypotenuse and area | Set 1
- Check if right triangle possible from given area and hypotenuse
- Area of triangle formed by the axes of co-ordinates and a given straight line
- Find area of the larger circle when radius of the smaller circle and difference in the area is given
- Maximum height when coins are arranged in a triangle
- Find area of triangle if two vectors of two adjacent sides are given
- Area of a Triangle from the given lengths of medians
- Program to calculate area and perimeter of equilateral triangle
- Number of possible pairs of Hypotenuse and Area to form right angled triangle
- Find the altitude and area of an isosceles triangle
- Program to calculate the Area and Perimeter of Incircle of an Equilateral Triangle
- Area of Triangle using Side-Angle-Side (length of two sides and the included angle)
- Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle
- Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle
- Maximum area of triangle having different vertex colors
- Program to find area of a 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 firstname.lastname@example.org. 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