#include <bits/stdc++.h>
using namespace std;
long long n, l, t[6600];
complex<double> z[6600];
complex<double> point(double theta) {
  return complex<double>(cos(theta), sin(theta));
}
complex<double> operator*(complex<double> a, double b) {
  return complex<double>(a.real() * b, a.imag() * b);
}
complex<double> operator*(double b, complex<double> a) {
  return complex<double>(a.real() * b, a.imag() * b);
}
complex<double> transpose(complex<double> a) {
  return complex<double>(a.imag(), a.real());
}
complex<double> ans;
void view(complex<double> x) { cout << x.real() << " " << x.imag() << endl; }
int main() {
  cin >> n >> l;
  long long all = n * (n - 1) / 2 * (n - 2) / 3;
  for (int i = 0; i < n; i++) {
    cin >> t[i];
    t[i + n] = t[i] + l;
    z[i + n] = z[i] = point(t[i] * (3.1415926535897932384626433832795028) / l);
  }
  for (int i = 0; i < n; i++) {
    complex<double> zsum = 0;
    for (int j = i + 1; j < i + n; j++) {
      double gamma = (t[i] + t[j]) * (3.1415926535897932384626433832795028) / l;
      double r =
          2 * sin((t[j] - t[i]) * (3.1415926535897932384626433832795028) / 2);
      ans += point(gamma) * (j - i - 1);
      ans += r * transpose(zsum * point(gamma / 2));
    }
  }
  printf("%.15lf %.15lf\n", -ans.real() / all, -ans.imag() / all);
  return 0;
}
