#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned long long;
using Complex = complex<ld>;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const ld PI = acosl(-1);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(12);
  cout << fixed;
  int n, l;
  cin >> n >> l;
  vector<ld> angle(n);
  vector<Complex> a(n);
  for (int i = 0; i < n; ++i) {
    ld alpha;
    cin >> alpha;
    alpha /= l;
    alpha *= 2 * PI;
    angle[i] = alpha;
    a[i] = {cosl(alpha), sinl(alpha)};
  }
  Complex res = 0;
  for (int i = 0; i < n; ++i) {
    Complex sum = 0;
    ld k = 0;
    for (int j = (i + 1 == n ? 0 : i + 1); j != i;
         j = (j + 1 == n ? 0 : j + 1)) {
      ld alpha = (angle[i] + angle[j]) / 2;
      if (i < j) {
        alpha += PI;
      }
      Complex v = {cosl(alpha), sinl(alpha)};
      ld len = abs(a[i] - v);
      Complex cur = sum * len;
      cur *= (a[i] - v) / len;
      cur += v * k;
      res += cur;
      sum += (a[j] - v) * conj(a[i] - v) / (len * len);
      k += 1;
    }
  }
  res /= 3 * n * (n - 1) * (n - 2) / 6;
  cout << res.real() << " " << res.imag() << endl;
}
