#include <bits/stdc++.h>
using namespace std;
using i64 = long;
const i64 MOD = 1e9 + 7;
const i64 INF = 1e18 + 7;
signed main() {
  int n, l;
  cin >> n >> l;
  vector<int> t(n);
  vector<double> x(n), y(n);
  for (int i = 0; i < n; ++i) {
    cin >> t[i];
    x[i] = cos(2.0 * M_PI * t[i] / l);
    y[i] = sin(2.0 * M_PI * t[i] / l);
  }
  vector<vector<double>> dist(n, vector<double>(n, 0));
  int cnt = 0;
  double sum = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      double xd = x[i] - x[j];
      double yd = y[i] - y[j];
      dist[i][j] = sqrt(xd * xd + yd * yd);
      ++cnt;
      sum += dist[i][j];
    }
  sum /= cnt;
  double sx = 0, sy = 0;
  for (int i = 0; i < n; ++i) {
    double d_sum = 0;
    cnt = 0;
    for (int j = 0; j < n; ++j)
      for (int k = j + 1; k < n; ++k) {
        if (i == j || i == k) continue;
        ++cnt;
        d_sum += dist[j][k] / (dist[i][j] + dist[j][k] + dist[i][k]);
      }
    d_sum /= cnt;
    sx += d_sum * x[i];
    sy += d_sum * y[i];
  }
  sx /= n;
  sy /= n;
  sx *= 3;
  sy *= 3;
  printf("%.20lf %.20lf\n", sx, sy);
}
