#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, l;
  cin >> n >> l;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    v.push_back(tmp);
  }
  double xans = 0.0, yans = 0.0;
  for (int i = 0; i < n - 2; i++) {
    for (int j = i + 1; j < n - 1; j++) {
      for (int k = j + 1; k < n; k++) {
        double x1, y1, x2, y2, x3, y3;
        x1 = cos(2.0 * M_PI * (double)v[i] / (double)l);
        y1 = sin(2.0 * M_PI * (double)v[i] / (double)l);
        x2 = cos(2.0 * M_PI * (double)v[j] / (double)l);
        y2 = sin(2.0 * M_PI * (double)v[j] / (double)l);
        x3 = cos(2.0 * M_PI * (double)v[k] / (double)l);
        y3 = sin(2.0 * M_PI * (double)v[k] / (double)l);
        double len1, len2, len3;
        len1 = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
        len2 = sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3));
        len3 = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
        xans += (len1 * x1 + len2 * x2 + len3 * x3) / (len1 + len2 + len3);
        yans += (len1 * y1 + len2 * y2 + len3 * y3) / (len1 + len2 + len3);
      }
    }
  }
  xans /= (double)(n * (n - 1) * (n - 2) / 6);
  yans /= (double)(n * (n - 1) * (n - 2) / 6);
  cout << xans << " " << yans << endl;
}
