#include <bits/stdc++.h>
using namespace std;
void calc_expectation(double x1, double y1, double x2, double y2, double x3,
                      double y3, double *x, double *y) {
  double l1 = sqrt(pow(x2 - x3, 2) + pow(y2 - y3, 2));
  double l2 = sqrt(pow(x1 - x3, 2) + pow(y1 - y3, 2));
  double l3 = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
  double cx = (l1 * x1 + l2 * x2 + l3 * x3) / (l1 + l2 + l3);
  double cy = (l1 * y1 + l2 * y2 + l3 * y3) / (l1 + l2 + l3);
  *x += cx;
  *y += cy;
}
int main() {
  int N, L;
  cin >> N >> L;
  int T[N];
  for (int i = 0; i < N; i++) {
    cin >> T[i];
  }
  double x[N], y[N];
  for (int i = 0; i < N; i++) {
    x[i] = cos(2 * M_PI * T[i] / L);
    y[i] = sin(2 * M_PI * T[i] / L);
  }
  double Ex = 0, Ey = 0;
  int n = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      for (int k = j + 1; k < N; k++) {
        calc_expectation(x[i], y[i], x[j], y[j], x[k], y[k], &Ex, &Ey);
        n++;
      }
    }
  }
  Ex /= n;
  Ey /= n;
  cout << Ex << " " << Ey << endl;
  return 0;
}
