#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll INF = 1e18;
inline void chmax(ll& a, ll b) { a = max(a, b); }
inline void chmin(ll& a, ll b) { a = min(a, b); }
int main() {
  ll n, l;
  cin >> n >> l;
  double pi = acos(-1);
  vector<ll> A(n);
  for (long long i = 0; i < (n); ++i) cin >> A[i];
  sort(A.begin(), A.end());
  vector<double> x(n);
  for (long long i = 0; i < (n); ++i) x[i] = cos(pi * A[i] / l);
  vector<double> y(n);
  for (long long i = 0; i < (n); ++i) y[i] = sin(pi * A[i] / l);
  double sumx = 0;
  double sumy = 0;
  double sumz = 0;
  for (long long i = 0; i < (n); ++i) {
    for (long long j = 0; j < (n); ++j) {
      if (i != j) {
        sumx += x[i] * x[j];
        sumy += y[i] * y[j];
        sumz += x[i] * y[j];
      }
    }
  }
  double kx = 0;
  double ky = 0;
  double kz = 0;
  for (long long i = 0; i < (n - 1); ++i) {
    for (long long j = i + 1; j <= n - 1; j++) {
      kx += x[i] * x[j] * (j - i - 1);
      ky += y[i] * y[j] * (j - i - 1);
      kz += x[i] * y[j] * (j - i - 1);
    }
  }
  double ansx = (sumx - sumy) * 3 / (n * (n - 1)) -
                (kx - ky) * 2 * 6 / (n * (n - 1) * (n - 2));
  double ansy = sumz * 6 / (n * (n - 1)) - kz * 2 * 6 / (n * (n - 1) * (n - 2));
  cout << fixed << setprecision(20);
  cout << ansx << endl;
  cout << ansy << endl;
  return 0;
}
