import math
def height_of_triangle(S, a):h = (2 * S) / (a + math.sqrt(a*2 + 4S))return round(h, 2)
S = 24a = 6result = height_of_triangle(S, a)print(result) # Output: 8.0
import math
def height_of_triangle(S, a):
h = (2 * S) / (a + math.sqrt(a*2 + 4S))
return round(h, 2)
S = 24
a = 6
result = height_of_triangle(S, a)
print(result) # Output: 8.0