import math

N, L = map(int, input().split())
Alterc = []
Alters = []
T = [int(input()) for i in range(N)]

x, y = 0, 0

for i in range(N-2):
  for j in range(i+1, N-1):
    x += (N+2*i-2*j)*math.cos(math.pi*(T[i]+T[j])/L)
    y += (N+2*i-2*j)*math.sin(math.pi*(T[i]+T[j])/L)
for i in range(N-2):
  x += (2*i+2-N)*math.cos(math.pi*(T[i]+T[N-1])/L)
  y += (2*i+2-N)*math.sin(math.pi*(T[i]+T[N-1])/L)
x += (N-2)*math.cos(math.pi*(T[N-2]+T[N-1])/L)
y += (N-2)*math.sin(math.pi*(T[N-2]+T[N-1])/L)
ratio = (N * (N - 1) * (N - 2)) // 6
x /= ratio
y /= ratio
print(x, y)