#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int N = 3003;
int n, L;
int a[N];
double X, Y;
int main() {
  scanf("%d %d", &n, &L);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      double t = 1.0 * (a[i] + a[j]) / L;
      double x = cos(pi * t);
      double y = sin(pi * t);
      X += x * (2 * (j - i) - n), Y += y * (2 * (j - i) - n);
    }
  }
  double P = 1.0 * (n * (n - 1) * (n - 2)) / 6;
  printf("%.10lf %.10lf\n", -1.0 * X / P, -1.0 * Y / P);
  return 0;
}
