#include <bits/stdc++.h>
using namespace std;
const int N = 3010;
double T[N], L;
int n;
double Pi = acos(-1.0) * 2;
int main() {
  scanf("%d %lf", &n, &L);
  for (int i = 1; i <= n; i++) scanf("%lf", &T[i]), T[i] /= L;
  double xx = 0, yy = 0, nowT;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      xx += cos(nowT * Pi) * (n - (j - i) * 2),
          yy += sin(nowT * Pi) * (n - (j - i) * 2);
  xx *= 6.0 / n / (n - 1) / (n - 2);
  yy *= 6.0 / n / (n - 1) / (n - 2);
  printf("%.15lf %.15lf", xx, yy);
}
