#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int read();
int n, L;
double a[3003];
struct P {
  double x, y;
  P operator+(P a) { return (P){x + a.x, y + a.y}; }
  P operator-(P a) { return (P){x - a.x, y - a.y}; }
  P operator*(P a) { return (P){x * a.x - y * a.y, x * a.y + y * a.x}; }
  P operator*(double a) { return (P){x * a, y * a}; }
} res;
P an(double a) { return (P){cos(a), sin(a)}; }
int main() {
  n = read(), L = read();
  for (int i = 0; i < n; ++i) a[i] = 2.0 * pi * read() / L;
  for (int i = 0; i < n; ++i) {
    double c = 0;
    P sum = (P){0, 0}, Ai = an(a[i]);
    for (int j = (i + 1) % n; j != i; (++j == n) ? j = 0 : 0) {
      double alpha = j > i ? a[j] - a[i] : a[j] - a[i] + 2.0 * pi;
      P M = an(a[j] + pi - alpha / 2);
      res = res + M * (c++) + (Ai - M) * sum, sum = sum + an(alpha / 2);
    }
  }
  double c = n * (n - 1) * (n - 2) / 2;
  printf("%.15lf %.15lf\n", res.x / c, res.y / c);
  return 0;
}
const int _SIZE = 1 << 22;
char ibuf[_SIZE], *iS = ibuf, *iT = ibuf;
int read() {
  int x = 0, f = 1;
  char c = (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)),
            (iS == iT ? EOF : *iS++) : *iS++);
  while (!isdigit(c))
    f = (c == '-') ? -1 : f,
    c = (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)),
         (iS == iT ? EOF : *iS++) : *iS++);
  while (isdigit(c))
    x = x * 10 + c - '0',
    c = (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)),
         (iS == iT ? EOF : *iS++) : *iS++);
  return x * f;
}
