#include <bits/stdc++.h>
using namespace std;
complex<double> naive(vector<double> angles) {
  int n = (int)angles.size();
  complex<double> total_sum(0);
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      for (int k = j + 1; k < n; ++k) {
        total_sum += polar(1., (angles[i] + angles[j]) / 2) +
                     polar(1., (angles[j] + angles[k]) / 2) -
                     polar(1., (angles[i] + angles[k]) / 2);
      }
    }
  }
  return total_sum / (double)(n * (n - 1) * (n - 2) / 6);
}
complex<double> smart(vector<double> angles) {
  int n = (int)angles.size();
  complex<double> ij_sum;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      ij_sum += polar(1., (angles[i] + angles[j]) / 2) * ((double)(n - j - 1));
    }
  }
  complex<double> jk_sum;
  for (int j = 0; j < n; ++j) {
    for (int k = j + 1; k < n; ++k) {
      jk_sum += polar(1., (angles[j] + angles[k]) / 2) * ((double)j);
    }
  }
  complex<double> ik_sum;
  for (int i = 0; i < n; ++i) {
    for (int k = i + 1; k < n; ++k) {
      ik_sum += polar(1., (angles[i] + angles[k]) / 2) * ((double)k - i - 1);
    }
  }
  complex<double> total_sum = ij_sum + jk_sum - ik_sum;
  return total_sum / (double)(n * (n - 1) * (n - 2) / 6);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, L;
  cin >> n >> L;
  double pi = atan(1) * 4;
  vector<double> angles(n);
  for (auto& angle : angles) {
    cin >> angle;
    angle *= 2 * pi / L;
  }
  complex<double> result = smart(angles);
  cout << setprecision(20) << real(result) << " " << imag(result) << endl;
  return 0;
}
