• + 0 comments
    from math import sqrt
    x = int(input())
    scores = [list(map(lambda a : float(a), input().split('\t'))) for _ in range(x)]
    m = list(map(lambda a : a[0], scores))
    p = list(map(lambda a : a[1], scores))
    c = list(map(lambda a : a[2], scores))
    
    def correlation(X, Y, N):
        numerator = (N * sum(map(lambda a,b : a*b, X, Y))) - (sum(X)*sum(Y))
        denominator = sqrt(N*sum(map(lambda a : a**2, X)) - (sum(X)**2)) * sqrt(N*sum(map(lambda a : a**2, Y)) - (sum(Y)**2))
        return numerator/denominator
    
    print('%.2f'%(correlation(m,p,x)))
    print('%.2f'%(correlation(p,c,x)))
    print('%.2f'%(correlation(c,m,x)))