#include <bits/stdc++.h>
using namespace std;
using ld = long double;
const ld PI = acos(-1);
ld d(ld a, ld b, ld c, ld e) {
  return sqrt((a - c) * (a - c) + (b - e) * (b - e));
}
signed main() {
  int N, L;
  cin >> N >> L;
  vector<int> t(N);
  for (int i = 0; i < N; i++) cin >> t[i];
  ld X, Y;
  vector<ld> x(N), y(N);
  for (int i = 0; i < N; i++)
    x[i] = cos(2 * PI * t[i] / L), y[i] = sin(2 * PI * t[i] / L);
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      for (int k = j + 1; k < N; k++) {
        ld a, b, c;
        a = d(x[i], y[i], x[j], y[j]);
        b = d(x[j], y[j], x[k], y[k]);
        c = d(x[k], y[k], x[i], y[i]);
        ld D = 1 / (a + b + c);
        X += (a * x[k] + b * x[i] + c * x[j]) * D;
        Y += (a * y[k] + b * y[i] + c * y[j]) * D;
      }
    }
  }
  X /= N * (N - 1) * (N - 2);
  X *= 6;
  Y /= N * (N - 1) * (N - 2);
  Y *= 6;
  cout << fixed << setprecision(12) << X << " ";
  cout << fixed << setprecision(12) << Y << endl;
}
