#include <bits/stdc++.h>
using namespace std;
int n, L;
double ang[3005];
double x, y;
int main() {
  cin >> n >> L;
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    ang[i] = 2 * acos(-1.0) * t / L;
  }
  x = y = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < n; j++) {
      double now = ang[(i + j) % n];
      if (now < ang[i]) now += 2 * acos(-1.0);
      now = (now + ang[i]) / 2;
      x += cos(now) * (n - j - 1) / n / (n - 1);
      y += sin(now) * (n - j - 1) / n / (n - 1);
    }
  }
  x /= ((n - 2) / 6);
  y /= ((n - 2) / 6);
  printf("%.15f %.15f\n", x, y);
  return 0;
}
