#include <bits/stdc++.h>
using namespace std;
const int max_n = 3033, inf = 1000111222;
const long double pi = 2 * acosl(0.0);
int n, l;
long double x[max_n], y[max_n], ang[max_n];
int rnd(int l, int r) { return l + rand() % (r - l + 1); }
long double triv(long double x[max_n]) {
  const int it = 1000000;
  long double res = 0;
  for (int Q = 0; Q < it; ++Q) {
    const int i = rnd(0, n - 3);
    const int j = rnd(i + 1, n - 2);
    const int k = rnd(j + 1, n - 1);
    long double l12 = sqrtl(1 - cos(ang[i] - ang[j]));
    long double l13 = sqrtl(1 - cos(ang[i] - ang[k]));
    long double l23 = sqrtl(1 - cos(ang[j] - ang[k]));
    res += (x[i] * l23 + x[j] * l13 + x[k] * l12) / (l12 + l13 + l23);
  }
  res /= it;
  return res;
}
int main() {
  cin >> n >> l;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    ang[i] = 2 * pi * t / l;
    x[i] = cosl(ang[i]);
    y[i] = sinl(ang[i]);
  }
  cout << fixed << setprecision(20) << triv(x) << " " << triv(y) << endl;
  return 0;
}
