#include <bits/stdc++.h>
const int inf = (1 << 30);
const int mod = 1000000007;
using ll = long long;
using ld = long double;
using namespace std;
int main() {
  int n, l;
  cin >> n >> l;
  vector<int> t(n);
  for (auto &k : t) cin >> k;
  ld ccx = 0;
  ld ccy = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      ld theta = (t[i] + t[j]) * M_PI / l;
      int an = j - i - 1;
      ccx += cos(theta) * (n - 2 - an);
      ccy += sin(theta) * (n - 2 - an);
      ccx -= cos(theta) * an;
      ccy -= sin(theta) * an;
    }
  }
  ll combi = n * (n - 1) * (n - 2) / 6;
  cout << fixed << setprecision(15) << ccx / combi << ' ' << ccy / combi
       << endl;
}
