from numpy import *

N,L = map(int, input().split())
T = []
for i in range(N):
    T.append(int(input()))
    
def abc(T,i,j,k,L):
    a = ((cos(2*pi*T[j]/L)-cos(2*pi*T[k]/L))**2+(sin(2*pi*T[j]/L)-sin(2*pi*T[k]/L))**2)**0.5
    b = ((cos(2*pi*T[k]/L)-cos(2*pi*T[i]/L))**2+(sin(2*pi*T[k]/L)-sin(2*pi*T[i]/L))**2)**0.5
    c = ((cos(2*pi*T[i]/L)-cos(2*pi*T[j]/L))**2+(sin(2*pi*T[i]/L)-sin(2*pi*T[j]/L))**2)**0.5
    return [a,b,c]

def xy(T,a,b,c,i,j,k,L):
    x = (a*cos(2*pi*T[i]/L)+b*cos(2*pi*T[j]/L)+c*cos(2*pi*T[k]/L))/(a+b+c)
    y = (a*sin(2*pi*T[i]/L)+b*sin(2*pi*T[j]/L)+c*sin(2*pi*T[k]/L))/(a+b+c)
    return [x,y]
      
x = 0
y = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            List = abc(T,i,j,k,L)
            a = List[0]
            b = List[1]
            c = List[2]
            List = xy(T,a,b,c,i,j,k,L)
            x += List[0]
            y += List[1]
            
S = N*(N-1)*(N-2)/6
x /= S
y /= S
print(x)
print(y)