[BOJ 26592] Triangle Height

View as PDF

Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 1G

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Your Math teacher asked you to write a program to help him generate homework solutions. The program will need to find the height of a triangle given its area and its base length.

Formula:

  • a = (h*b)/2 (a – area, b – base length, h – height)

입력 형식

The first line will contain a single integer n that indicates the number of lines that follow. Each line will include the area and base length of a triangle with the two values separated by a single space.

area base

출력 형식

For each input display the height of the triangle with 2 decimal places, in the following format:

The height of the triangle is #.## units

예제 입력

4
200.533 40.5
10.6 1.11
30 30
3333 50.7

예제 출력

The height of the triangle is 9.90 units
The height of the triangle is 19.10 units
The height of the triangle is 2.00 units
The height of the triangle is 131.48 units

Comments

There are no comments at the moment.