#C4872. Triangle Validity and Area Calculation
Triangle Validity and Area Calculation
Triangle Validity and Area Calculation
This problem requires you to determine if three given side lengths can form a valid triangle and, if so, compute the area of the triangle using Heron's formula. A triangle is valid if and only if the sum of any two sides is greater than the third side. If the given sides form a valid triangle, calculate the area and round the result to two decimal places. Otherwise, output "Invalid".
Recall that Heron's formula is given by:
[ A = \sqrt{s(s-a)(s-b)(s-c)} ]
where \( s = \frac{a+b+c}{2} \) is the semi-perimeter.
inputFormat
The input is provided via standard input (stdin) and consists of three space-separated positive numbers representing the side lengths of a triangle.
outputFormat
Output the area of the triangle (rounded to two decimal places) if the sides can form a valid triangle. Otherwise, output "Invalid". The result should be printed to standard output (stdout).
## sample3 4 5
6.00