import math
import time
import numpy as np

N, L = map(int, input().split())
nodes = []
for i in range(N):
    nodes.append(int(input()))

start = time.time()
def calc_naishin(a, b, c):
    a_x, a_y = a
    b_x, b_y = b
    c_x, c_y = c
    A = math.sqrt((b_x-c_x)**2 + (b_y-c_y)**2)
    B = math.sqrt((c_x-a_x)**2 + (c_y-a_y)**2)
    C = math.sqrt((a_x-b_x)**2 + (a_y-b_y)**2)
    n_x = (A*a_x + B*b_x + C*c_x) / (A + B + C)
    n_y = (A*a_y + B*b_y + C*c_y) / (A + B + C)
    return n_x, n_y

counter = 0
sum_x = 0.0
sum_y = 0.0

x = np.array([i for i in range(L)])
cos_x = np.cos(2*math.pi*x/L)
sin_x = np.sin(2*math.pi*x/L)

"""
for i in range(len(nodes) - 2):
    for j in range(i+1, len(nodes) - 1):
        for k in range(j+1, len(nodes)):
            a = ((math.cos((2*math.pi*nodes[i])/L)), math.sin((2*math.pi*nodes[i])/L))
            b = ((math.cos((2*math.pi*nodes[j])/L)), math.sin((2*math.pi*nodes[j])/L))
            c = ((math.cos((2*math.pi*nodes[k])/L)), math.sin((2*math.pi*nodes[k])/L))
            n_x, n_y = calc_naishin(a, b, c)
            print(n_x, n_y)
            sum_x += n_x
            sum_y += n_y
            counter += 1

"""
for i, T_i in enumerate(nodes[:-2]):
    for j, T_j in enumerate(nodes[i+1:-1], start=i+1):
        for k, T_k in enumerate(nodes[j+1:], start=j+1):
            a = (cos_x[T_i], sin_x[T_i])
            b = (cos_x[T_j], sin_x[T_j])
            c = (cos_x[T_k], sin_x[T_k])
            n_x, n_y = calc_naishin(a, b, c)
            #print(n_x, n_y)
            sum_x += n_x
            sum_y += n_y
            counter += 1

print(sum_x/counter, sum_y/counter)
#print(time.time() - start)