#include <bits/stdc++.h>
double distTable[3002][3002];
struct point {
  double x, y;
};
double dist(point a, point b) {
  double dx = a.x - b.x;
  double dy = a.y - b.y;
  return sqrt(dx * dx + dy * dy);
}
int main(void) {
  int N, i, L, j, k, count = 0;
  int T[3002];
  const double PI = acos(-1);
  double d_ab, d_ac, d_bc;
  double ex_x, ex_y;
  point a[3002], pa, pb, pc;
  scanf("%d%d", &N, &L);
  for (i = 0; i < N; i++) {
    scanf("%d", T + i);
    a[i].x = cos(PI * 2 * T[i] / L);
    a[i].y = sin(PI * 2 * T[i] / L);
  }
  for (i = 0; i < N; i++) {
    for (j = 0; j < i; j++) {
      distTable[i][j] = dist(a[i], a[j]);
      distTable[j][i] = distTable[i][j];
    }
  }
  ex_x = 0;
  ex_y = 0;
  for (i = 0; i < N - 2; i++) {
    pa = a[i];
    for (j = i + 1; j < N - 1; j++) {
      pb = a[j];
      for (k = j + 1; k < N; k++) {
        pc = a[k];
        d_ab = distTable[i][j];
        d_ac = distTable[i][k];
        d_bc = distTable[j][k];
        ex_x +=
            (d_bc * pa.x + d_ac * pb.x + d_ab * pc.x) / (d_ab + d_ac + d_bc);
        ex_y +=
            (d_bc * pa.y + d_ac * pb.y + d_ab * pc.y) / (d_ab + d_ac + d_bc);
        count += 1;
      }
    }
  }
  printf("%.13lf %.13lf\n", ex_x / count, ex_y / count);
  return 0;
}
