#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int n, l;
double t[3003], x, y;
inline void add(double rad, int cnt) {
  x += cos(rad) * cnt;
  y += sin(rad) * cnt;
}
int main() {
  scanf("%d%d", &n, &l);
  for (int i = 0; i < n; i++) {
    scanf("%lf", &t[i]);
    t[i] = t[i] / l * 2 * pi;
  }
  sort(t, t + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      double m1 = (t[i] + t[j]) / 2, m2 = m1 + pi;
      add(m1, i + n - j - 1);
      add(m2, j - i - 1);
    }
  }
  double all = n * (n - 1) * (n - 2) / 6;
  x /= all, y /= all;
  printf("%.11f %.11f\n", x, y);
}
