#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const long long dx[4] = {1, 0, -1, 0};
const long long dy[4] = {0, 1, 0, -1};
long long x[3000], y[3000];
long long d[3000][3000];
constexpr double PI2 = 3.1415926535897932384626 * 2;
signed main() {
  long long N, L;
  cin >> N >> L;
  constexpr long long bai = 100000000;
  for (long long i = 0, i_len = (N); i < i_len; ++i) {
    long long T;
    cin >> T;
    x[i] = cos(PI2 * T / L) * bai;
    y[i] = sin(PI2 * T / L) * bai;
  }
  for (long long i = 0; i < N; i++) {
    for (long long j = i + 1; j < N; j++) {
      long long t1 = x[i] - x[j];
      long long t2 = y[i] - y[j];
      d[i][j] = sqrt(t1 * t1 + t2 * t2);
      d[j][i] = d[i][j];
    }
  }
  double ansx = 0.0, ansy = 0.0;
  for (long long i = 0; i < N; i++) {
    for (long long j = i + 1; j < N; j++) {
      for (long long k = j + 1; k < N; k++) {
        long long bunbo = d[i][j] + d[j][k] + d[k][i];
        long long cx = d[j][k] * x[i] + d[k][i] * x[j] + d[i][j] * x[k];
        long long cy = d[j][k] * y[i] + d[k][i] * y[j] + d[i][j] * y[k];
        ansx += (double)cx / bunbo;
        ansy += (double)cy / bunbo;
      }
    }
  }
  long long cnt = N * (N - 1) * (N - 2) / 6;
  ansx /= cnt;
  ansy /= cnt;
  cout << fixed << setprecision(16) << ansx / bai << " " << ansy / bai << endl;
  return 0;
}
