#include <bits/stdc++.h>
using namespace std;
#define mod 1000000000
#define ll long long

#define maxn 3005
#define pi acos(-1.0)

int n, L;
double ang[maxn];
double x, y;

int main()
{
    cin >> n >> L;
    for (int i = 0; i < n; i++)
    {
        int t;
        scanf("%d", &t);
        ang[i] = 2 * pi * t / L;
    }
    x = y = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = 1; j < n; j++)
        {
            double now = ang[(i + j) % n];
            if (now < ang[i])
                now += 2 * pi;
            now = (now + ang[i]) / 2;
            x += cos(now) * (n - j - 1) / n / (n - 1);
            y += sin(now) * (n - j - 1) / n / (n - 1);
        }
    }
    x /= ((n - 2.0) / 6);
    y /= ((n - 2.0) / 6);
    printf("%.15f %.15f\n", x, y);

    return 0;
}