#PCBBAY0000059. Diện tích tam giác Heron (Triangle Area by Heron Formula)
Diện tích tam giác Heron (Triangle Area by Heron Formula)
Triangle Area by Heron Formula
Version: Phuoc Hung OJ Extended
Problem Statement
Given side lengths , , of a valid triangle, let its semiperimeter be . Heron’s formula gives the area . Print with exactly 4 decimal places.
Input
The only line contains real side lengths , , of the triangle.
Output
Print the triangle area with exactly 4 decimal places.
Subtasks
- Subtask 1 (100 points): and the three sides form a valid triangle (each pair of sides sums to more than the remaining side).
Examples
Example 1
Input
3 4 5
Output
6.0000
Explanation. Substituting 3, 4, 5 into sqrt(s(s-a)(s-b)(s-c)) gives approximately 6. The required output formatting produces 6.0000.
Example 2
Input
5 5 6
Output
12.0000
Explanation. Substituting 5, 5, 6 into sqrt(s(s-a)(s-b)(s-c)) gives approximately 12. The required output formatting produces 12.0000.
Example 3
Input
2.5 3.5 4
Output
4.3301
Explanation. Substituting 2.5, 3.5, 4 into sqrt(s(s-a)(s-b)(s-c)) gives approximately 4.33012701892. The required output formatting produces 4.3301.