BOJ - 16489 - 삼각형 해커

Updated:

import sys
from decimal import *
import math

def solution():
    getcontext()
    getcontext().prec = 14
    A, B, C = map(Decimal, sys.stdin.readline().split())

    s = (A + B + C) / 2
    S = Decimal(str(math.sqrt(s * (s - A) * (s - B) * (s - C))))

    R = (A * B * C) / (4 * S)
    r = (2 * S) / (A + B + C)
    d = (A * B * C / (4 * S) - (4 * S / (A + B + C)))
    if d <= 0:
        d = 0
    else:
        d = math.sqrt(A * B * C / (4 * S) * d)
    k = (A * B * C / (4 * S) + 2 * S / (A + B + C))
    S = math.sqrt(s * (s - A) * (s - B) * (s - C))
    print(S)
    print(R)
    print(r)
    print(d)
    print(k)

solution()

https://www.acmicpc.net/problem/16489

Categories:

Updated:

Leave a comment