#include <bits/stdc++.h>
using namespace std;
long double pi = acos(-1);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(10);
  int n, l;
  cin >> n >> l;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  long double x = 0, y = 0;
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) {
      long double X = cos(pi * (long double)(v[i] + v[j]) / (long double)l);
      x += (long double)(i + (n - j - 1) - (j - i - 1)) * X;
      long double Y = sin(pi * (long double)(v[i] + v[j]) / (long double)l);
      y += (long double)(i + (n - j - 1) - (j - i - 1)) * Y;
    }
  long double cnt = n * (n - 1) * (n - 2) / 6;
  cout << fixed << x / cnt << " " << y / cnt << endl;
}
