#P5708. 【深基2.习2】三角形面积

【深基2.习2】三角形面积

Triangle Area

Problem Source

Luogu P5708

Problem Description

A triangle has side lengths aa, bb, cc; its area is p(p−a)(p−b)(p−c)\sqrt{p(p-a)(p-b)(p-c)}, where p=12(a+b+c)p = \frac{1}{2}(a+b+c). Input these three numbers and compute the area of the triangle, rounded to 11 decimal place.

Input Format

The first line contains three real numbers a,b,ca, b, c, separated by spaces.

Output Format

Output one real number: the area of the triangle, kept to 11 decimal place.

Sample Input

3 4 5

Sample Output

6.0

Hint

  • Heron's formula was used in the previous problem: compute pp first, then apply the formula. The new thing here is the output: keep 1 decimal place.
  • The sides are decimals, so choose the right type.
  • Check against the sample: 3 4 5 → 6.0.

The data guarantees a valid triangle can be formed, with 0≤a,b,c≤10000 \le a, b, c \le 1000, and each side having at most 22 decimal places on input.