#include <bits/stdc++.h>
using namespace std;
struct line {
  double a, b, c;
};
long long tp = 100000000;
long long n;
long long l;
double dist[3001][3001];
pair<double, double> p[3002];
pair<double, double> operator-(pair<double, double> x, pair<double, double> y) {
  return {x.first - y.first, x.second - y.second};
}
pair<double, double> operator+(pair<double, double> x, pair<double, double> y) {
  return {x.first + y.first, x.second + y.second};
}
pair<double, double> intersect(line g, line h) {
  double xp, yp;
  if (g.a == h.a) {
    yp = (h.c - g.c) / (g.b - h.b);
    if (g.a == 0)
      xp = (-h.c - yp * h.b) / h.a;
    else
      xp = (-g.c - yp * g.b) / g.a;
    return {xp, yp};
  } else {
    yp = (g.a * h.c - h.a * g.c) / (h.a * g.b - g.a * h.b);
    if (g.a == 0)
      xp = (-h.c - yp * h.b) / h.a;
    else
      xp = (-g.c - yp * g.b) / g.a;
    return {xp, yp};
  }
}
pair<double, double> center(int i, int j, int k) {
  pair<double, double> vp1 = p[j] - p[i];
  pair<double, double> vp2 = p[k] - p[i];
  vp1 = {vp1.first / dist[i][j], vp1.second / dist[i][j]};
  vp2 = {vp2.first / dist[i][k], vp2.second / dist[i][k]};
  pair<double, double> v1 = vp1 + vp2;
  vp1 = p[i] - p[j];
  vp2 = p[k] - p[j];
  vp1 = {vp1.first / dist[i][j], vp1.second / dist[i][j]};
  vp2 = {vp2.first / dist[j][k], vp2.second / dist[j][k]};
  pair<double, double> v2 = vp1 + vp2;
  return intersect({v1.second, -v1.first,
                    -(v1.second * p[i].first - v1.first * p[i].second)},
                   {v2.second, -v2.first,
                    -(v2.second * p[j].first - v2.first * p[j].second)});
}
int main() {
  int n;
  scanf("%d", &n);
  scanf("%lld", &l);
  long long t;
  double pi = acos(-1.0);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &t);
    p[i] = {cos(2.0 * pi * t / l), sin(2.0 * pi * t / l)};
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      dist[i][j] =
          sqrt((p[i].first - p[j].first) * (p[i].first - p[j].first) +
               (p[i].second - p[j].second) * (p[i].second - p[j].second));
    }
  }
  long long cnt = min(n * (n - 1) * (n - 2) / 6ll, tp);
  if (cnt == tp) {
    srand(12312);
    pair<double, double> act = {0, 0};
    for (int i = 0; i < cnt; i++) {
      int x = rand() % n;
      int y = rand() % (n - 1);
      int z = rand() % (n - 2);
      if (y >= x) y++;
      if (z >= x && z >= y)
        z += 2;
      else {
        if (z >= x || z >= y) z += 1;
      }
      act = act + center(x, y, z);
    }
    printf("%.12lf %.12lf\n", act.first / cnt, act.second / cnt);
  } else {
    pair<double, double> act = {0, 0};
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        for (int k = j + 1; k < n; k++) {
          act = act + center(i, j, k);
        }
      }
    }
    printf("%.12lf %.12lf\n", act.first / cnt, act.second / cnt);
  }
  return 0;
}
