#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using ld = long double;
constexpr ld pi = M_PI;
int main() {
  const auto start = chrono::system_clock::now();
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  ld L;
  cin >> N >> L;
  ld T[N];
  for (size_t i = 0; i < N; i++) {
    cin >> T[i];
  }
  ld angle[N];
  for (size_t i = 0; i < N; i++) {
    angle[i] = 2.0L * pi * T[i] / L;
  }
  ld Sin[N];
  for (size_t i = 0; i < N; i++) {
    Sin[i] = sinl(angle[i]);
  }
  ld Cos[N];
  for (size_t i = 0; i < N; i++) {
    Cos[i] = cosl(angle[i]);
  }
  ld table[N][N];
  for (size_t i = 0; i < N; i++) {
    for (size_t j = 0; j < N; j++) {
      table[i][j] = sqrtl(1.0L - cosl(angle[i] - angle[j]));
    }
  }
  ld x = 0.0L;
  ld y = 0.0L;
  ld cnt = 0;
  random_device rnd;
  mt19937 rng(rnd());
  while (true) {
    const auto end = chrono::system_clock::now();
    if (chrono::duration_cast<chrono::milliseconds>(end - start).count() >
        3990) {
      break;
    }
    int i, j, k;
    i = rng() % N;
    j = rng() % N;
    while (i == j) j = rng() % N;
    k = rng() % N;
    while (i == k || j == k) k = rng() % N;
    const ld inv = table[i][j] + table[j][k] + table[k][i];
    x += (table[i][j] * Cos[k] + table[k][i] * Cos[j] + table[j][k] * Cos[i]) /
         inv;
    y += (table[i][j] * Sin[k] + table[k][i] * Sin[j] + table[j][k] * Sin[i]) /
         inv;
    cnt += 1.0L;
  }
  cout << fixed << setprecision(20) << x / cnt << ' ' << y / cnt << endl;
}
