#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
struct Point {
  double x, y;
  Point operator+(const Point &A) { return {x + A.x, y + A.y}; }
};
int l, a[10004];
Point calc(double i, int c) {
  double ang = 2 * pi * i / l;
  return {cos(ang) * c, sin(ang) * c};
}
int main() {
  int n;
  cin >> n >> l;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  Point ans = {0.0, 0.0};
  for (int i = 1; i <= n; ++i)
    for (int j = i + 1; j <= n; ++j) {
      ans = ans + calc((a[i] + a[j]) / 2.0, n - (j - i + 1));
      ans = ans + calc((a[i] + a[j]) / 2.0 + l / 2.0, j - i - 1);
    }
  long long s = n * (n - 1) * (n - 2) / 6;
  printf("%.10f %.10f", ans.x / s, ans.y / s);
}
