Question 20 || Hacker Rank
Small Triangles, Large Triangles || Hacker Rank
You are
given n triangles, explicitly, their sides ai, bi
and ci. Print them in a similar style however arranged by
their region from the littlest one to the biggest one. It is ensured that every
one of the areas are unique.
The most
effective way to compute a region of a triangle with sides a, b and c is
Heron's formula:
Input Configuration
The main
line of each test record contains a solitary whole number n. lines
follow with three space-isolated whole numbers ai, bi
and ci
Imperatives
Yield Configuration
Print
precisely lines. On each line print space-isolated numbers and of the relating
triangle.
Test Info
0
3
7 24 25
5 12 13
3 4 5
Test
Result 0
3 4 5
5 12 13
7 24 25
Clarification
0
The square
of the main triangle is 84. The square of the second subsequent triangle is 30.
The square of the third triangle is 6. So, the arranged request is the converse
i.e., reverse one.
0 Comments