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

#define rep(i,s,n) for(ll i = (s); i < (n); i++)
#define rep0(i,n) rep(i,0,n)

#define BR "\n"
#define SP " "
#define fcout cout << fixed << setprecision(18)

int main() {
  int N, L;
  cin >> N >> L;

  double pi = 3.14159265358979;
  vector<double> T(N);

  rep0(i, N) {
    double t; cin >> t;
    T[i] = 2 * pi * t / L;
  }

  double ansx = 0, ansy = 0;
  rep0(i, N) {
    rep(j, i + 1, N) {
      double t1, t2, c1, c2;
      if (i == j) continue;
      c1 = j - i - 1;
      c2 = N - 2 - c1;
      t1 = (T[i] + T[j]) / 2 + pi;
      t2 = (T[i] + T[j]) / 2;
      ansx += c1 * cos(t1) + c2 * cos(t2);
      ansy += c1 * sin(t1) + c2 * sin(t2);
    }
  }
  ansx = ansx * 6 / N / (N - 1) / (N - 2);
  ansy = ansy * 6 / N / (N - 1) / (N - 2);
  fcout << ansx << SP << ansy << BR;

  return 0;
}