#include <bits/stdc++.h>
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
int N;
double L, T[3000], x, y;
int main() {
  cin >> N >> L;
  for (int i = 0; i < N; ++i) {
    cin >> T[i];
    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) {
        double a = sqrt((cos(2.0 * M_PI * T[j]) - cos(2.0 * M_PI * T[k])) *
                            (cos(2.0 * M_PI * T[j]) - cos(2.0 * M_PI * T[k])) +
                        (sin(2.0 * M_PI * T[j]) - sin(2.0 * M_PI * T[k])) *
                            (sin(2.0 * M_PI * T[j]) - sin(2.0 * M_PI * T[k])));
        double b = sqrt((cos(2.0 * M_PI * T[i]) - cos(2.0 * M_PI * T[k])) *
                            (cos(2.0 * M_PI * T[i]) - cos(2.0 * M_PI * T[k])) +
                        (sin(2.0 * M_PI * T[i]) - sin(2.0 * M_PI * T[k])) *
                            (sin(2.0 * M_PI * T[i]) - sin(2.0 * M_PI * T[k])));
        double c = sqrt((cos(2.0 * M_PI * T[j]) - cos(2.0 * M_PI * T[i])) *
                            (cos(2.0 * M_PI * T[j]) - cos(2.0 * M_PI * T[i])) +
                        (sin(2.0 * M_PI * T[j]) - sin(2.0 * M_PI * T[i])) *
                            (sin(2.0 * M_PI * T[j]) - sin(2.0 * M_PI * T[i])));
        x += (a * cos(2.0 * M_PI * T[i]) + b * cos(2.0 * M_PI * T[j]) +
              c * cos(2.0 * M_PI * T[k])) /
             (a + b + c);
        y += (a * sin(2.0 * M_PI * T[i]) + b * sin(2.0 * M_PI * T[j]) +
              c * sin(2.0 * M_PI * T[k])) /
             (a + b + c);
      }
    }
  }
  x /= N;
  x /= N - 1;
  x /= N - 2;
  x *= 6;
  y /= N;
  y /= N - 1;
  y /= N - 2;
  y *= 6;
  printf("%.10f %.10f\n", x, y);
}
