#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
using namespace std;
constexpr int maxn = 3010;
float X[maxn], Y[maxn];
float A[maxn];
float d[maxn][maxn];
int main() {
  int n, l;
  cin >> n >> l;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    float alpha = 2.0 * M_PI * t / l;
    A[i] = alpha;
    X[i] = cos(alpha);
    Y[i] = sin(alpha);
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) d[i][j] = hypot((X[i] - X[j]), (Y[i] - Y[j]));
  float sx = 0, sy = 0;
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) {
      float dij = d[i][j];
      float* di = d[i];
      float* dj = d[j];
      for (int k = 0; k < n; ++k) {
        float den = dij / (dij + di[k] + dj[k]);
        sx += X[k] * den;
        sy += Y[k] * den;
      }
      float deni = dij / (dij + di[i] + dj[i]);
      float denj = dij / (dij + di[j] + dj[j]);
      sx -= X[i] * deni;
      sx -= X[j] * denj;
      sy -= Y[i] * deni;
      sy -= Y[j] * denj;
    }
  float den = (float)n * float(n - 1) * float(n - 2) / 6.0;
  sx /= den;
  sy /= den;
  printf("%.20f %.20f\n", sx, sy);
  return 0;
}
