#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = 3.14159265358979323846;
mt19937 mt(736);
double len(const complex<double> &a) {
  return sqrt(a.real() * a.real() + a.imag() * a.imag());
}
void solve(istream &cin = std::cin, ostream &cout = std::cout) {
  int n, l;
  cin >> n >> l;
  vector<complex<double>> pnt(n);
  for (auto &it : pnt) {
    int t;
    cin >> t;
    auto ang = 2 * pi * t / l;
    it = {cos(ang), sin(ang)};
  }
  complex<double> ans;
  for (int i = 0; i < pnt.size(); i++)
    for (int j = i + 1; j < pnt.size(); j++)
      for (int k = j + 1; k < pnt.size(); k++) {
        auto &A = pnt[i];
        auto &B = pnt[j];
        auto &C = pnt[k];
        auto a = len(B - C);
        auto b = len(A - C);
        auto c = len(A - B);
        ans += (a * A + b * B + c * C) / (a + b + c);
      }
  auto C3 = [](int n) { return n * (n - 1ll) * (n - 2ll) / 6; };
  ans /= C3(pnt.size());
  cout << setprecision(20) << ans.real() << ' ' << ans.imag() << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed;
  solve();
  return 0;
}
