#include<bits/stdc++.h>

using namespace std;

#define ll  long long
#define ld  double

#define sz(x)   (int)x.size()
#define all(x)  x.begin(),x.end()

#define pb  emplace_back
#define X   first
#define Y   second

const int   N   = 2e5 + 5;
const ld    pi  = acos(-1);

typedef pair<int,int>   ii;

ld  t[N];

int main()  {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    cout << fixed << setprecision(10);

    int n;  cin >> n;
    int L;  cin >> L;

    for(int i = 0 ; i < n ; ++i)    {
        int x;  cin >> x;

        t[i] = 1.0 * x / L;
    }
    ld  ansx = 0;
    ld  ansy = 0;

    for(int i = 0 ; i < n ; ++i)
    for(int j = 1 ; j < n ; ++j)    {
        ld  Ratio = t[i] + t[(i + j) % n];

        if (i + j >= n)
            Ratio += 1;

        ld  x = cos(pi * Ratio);
        ld  y = sin(pi * Ratio);

        ansx += x * (n - j - 1);
        ansy += y * (n - j - 1);
    }
    for(int i = 0 ; i < 3 ; ++i)
        ansx /= (n - i),
        ansy /= (n - i);

    cout << ansx * 6 << " ";
    cout << ansy * 6 << endl;
}