#include <bits/stdc++.h>
using namespace std;
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 - 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 * 3.1415926535 * (T[i] + T[j]) / (double)(2 * L));
      double y0 = (coef1 - coef2) *
                  sin(2 * 3.1415926535 * (T[i] + T[j]) / (double)(2 * L));
      x += x0;
      y += y0;
    }
  }
  x /= N * (N - 1) * (N - 2) / 6.0;
  y /= N * (N - 1) * (N - 2) / 6.0;
  fprintf(stdout, "%.10f %.10f\n", x, y);
  return 0;
}
