import math

N, L = map(int, input().split())
A = []
Tix = []
for i in range(N):
  T = int(input())
  Tix.append(T)
  A.append([math.cos(2*math.pi*T/L), math.sin(2*math.pi*T/L)])

dist = []
for j in range(N):
  di = []
  for k in range(N):
    di.append(abs(math.sin(math.pi*(Tix[j]-Tix[k])/L)))
  dist.append(di)
x, y = 0, 0
for i in range(N-2):
  for j in range(i+1, N-1):
    for k in range(j+1, N):
      dx = A[i][0] * dist[j][k] + A[j][0] * dist[k][i] + A[k][0] * dist[i][j]
      dy = A[i][1] * dist[j][k] + A[j][1] * dist[k][i] + A[k][1] * dist[i][j]
      dist_sum = dist[j][k] + dist[k][i] + dist[i][j]
      x += dx / dist_sum
      y += dy / dist_sum
x *= 6
x /= N * (N - 1) * (N - 2)
y *= 6
y /= N * (N - 1) * (N - 2)
print(x, y)