#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, l;
  cin >> n >> l;
  vector<int> t(n);
  for (int i = 0; i < n; i++) cin >> t[i];
  const double pi = acos(-1);
  double x = 0, y = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      double se = pi + pi * (t[i] + t[j]) / l;
      int d = i - j - 1;
      x += d * cos(se), y += d * sin(se);
      se -= pi;
      d = n - 2 - d;
      x += d * cos(se), y += d * sin(se);
    }
  }
  int d = n * (n - 1) * (n - 2) / 6;
  x /= d, y /= d;
  cout << fixed << setprecision(12) << x << " " << y << endl;
}
