#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
using P = complex<double>;
int main() {
  int n;
  cin >> n;
  double l;
  cin >> l;
  vector<int> t(n);
  for (int i = 0; i < n; i++) cin >> t[i];
  vector<double> x(n), y(n);
  for (int i = 0; i < n; i++)
    x[i] = cos(2 * pi * t[i] / l), y[i] = sin(2 * pi * t[i] / l);
  vector<P> p(n);
  for (int i = 0; i < n; i++) p[i] = {x[i], y[i]};
  P res = P(0, 0);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      for (int k = 0; k < j; k++) {
        double a = abs(p[i] - p[j]);
        double b = abs(p[j] - p[k]);
        double c = abs(p[k] - p[i]);
        res += (a * p[k] + b * p[i] + c * p[j]) / (a + b + c);
      }
    }
  }
  ll n2 = n;
  res /= n2 * (n2 - 1) * (n2 - 2) / 6;
  cout << setprecision(10) << fixed;
  cout << real(res) << " " << imag(res) << endl;
  return 0;
}
