#include<iostream>
#include <bits/stdc++.h>
#include <cstdio>
#include<set>
using namespace std;

#define PI 3.141592653589793238
int N;

int main()
{
    double x = 0.0, y = 0.0;
    int N, L;
    cin >> N;
    cin >> L;
    vector<int> T(N);
    for (int i = 0; i < N; i++)
        cin >> T[i];
    //for (int i = 0; i < N ; i++){
    //    fprintf(stderr, "%f, %f\n", cos(2 * PI * T[i]/(double)L), sin(2 * PI * T[i]/(double)L));
        
    //}
    for (int i = 0; i < N - 1; i++){
        for (int j = i + 1; j < N; j++){
            int coef2 = j - i - 1;
            int coef1 = N - 2 - coef2;
            double x0 = (coef1 - coef2) * cos(2 * PI * (T[i] + T[j])/(double)(2*L));
            double y0 = (coef1 - coef2) * sin(2 * PI * (T[i] + T[j])/(double)(2*L));
            //fprintf(stderr, "%d, %d: %f, %f\n", i, j, x0, y0);
            x += x0;
            y += y0;
        }
    }
    x /= N *(N - 1.) * (N - 2)/6.0;   
    y /= N *(N - 1.) * (N - 2)/6.0;
    //x *= 3.0;
    //y *= 3.0;
    cout<<setprecision(10)<<x<<' '<<y<<endl;
    //fprintf(stdout, "%.15f %.15f\n", x, y);
    //cout << x << " " << y << endl;
    return 0;    
}
