Minimum Height Triangle: Hackerrank
In the first and only line, there are two space-separated integers b and a , denoting respectively the base of a triangle and the desired minimum area.
In a single line, print a single integer h, denoting the minimum height of a triangle with base b and area at least a.
Sample Input 0
Sample Output 0
Sample Input 1
Sample Output 1
The task is to find the smallest integer height of the triangle with base and area at least . It turns out, that there are triangles with height , base and area , for example a triangle with corners in the following points: .
It can be proved that there is no triangle with integer height smaller than , base and area at least .
Pretty easy problem. Simple area calculations.