#include <bits/stdc++.h>
using namespace std;
int read() {
  int s = 0, t = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') t = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * t;
}
const double PI = acos(-1.0);
double x, y, num[3010];
int n, l;
void add(double ang, int cnt) { x += cos(ang) * cnt, y += sin(ang) * cnt; }
int main() {
  n = read(), l = read();
  for (int i = 1; i <= n; i++) num[i] = (double)read() / l * 2 * PI;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      double p1 = (num[i] + num[j]) * 0.5;
      double p2 = p1 + PI;
      add(p1, n + i - j - 1);
      add(p2, j - i - 1);
    }
  int tot = n * (n - 1) * (n - 2) / 6;
  x /= tot, y /= tot;
  printf("%.12lf %.12lf\n", x, y);
  return 0;
}
