import itertools
import numpy as np
import sys


def solve():

    def calc_center(a, b, c, va, vb, vc):
        return (a * va + b * vb + c * vc) / (a + b + c)

    def get_coordinate(t, L):
        rad = (2 * np.pi * t)/L
        x = np.cos(rad)
        y = np.sin(rad)
        return np.array([x, y])

    s = sys.stdin.readlines()
    N, L = map(int, s[0].split())
    Ts = list(map(int, s[1:]))

    combinations = list(itertools.combinations(Ts, 3))

    total = 0
    for combination in combinations:
        ta = combination[0]
        tb = combination[1]
        tc = combination[2]

        va = get_coordinate(ta, L)
        vb = get_coordinate(tb, L)
        vc = get_coordinate(tc, L)

        la = np.linalg.norm(vb-vc)
        lb = np.linalg.norm(vc-va)
        lc = np.linalg.norm(va-vb)

        center = calc_center(la, lb, lc, va, vb, vc)
        total += center

    expected = total / len(combinations)
    print(expected[0], expected[1])


if __name__ == '__main__':
    solve()