#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265358979323;
const long long mod = 998244353;
int n, l;
int t[3001];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> l;
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
  }
  if (n == 3) {
    long double ax = cos(2 * pi * t[1] / l), ay = sin(2 * pi * t[1] / l);
    long double bx = cos(2 * pi * t[2] / l), by = sin(2 * pi * t[2] / l);
    long double cx = cos(2 * pi * t[3] / l), cy = sin(2 * pi * t[3] / l);
    long double a = sqrt((bx - cx) * (bx - cx) + (by - cy) * (by - cy));
    long double b = sqrt((ax - cx) * (ax - cx) + (ay - cy) * (ay - cy));
    long double c = sqrt((bx - ax) * (bx - ax) + (by - ay) * (by - ay));
    cout << fixed << setprecision(10)
         << (a * ax + b * bx + c * cx) / (a + b + c) << ' '
         << (a * ay + b * by + c * cy) / (a + b + c) << endl;
    return 0;
  }
  sort(t + 1, t + n + 1);
  long double x = 0, y = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      x += cos(2 * pi * (t[i] + t[j]) / l / 2) *
           ((n - j + i - 1) * (n - j + i - 2) / 2 -
            (j - i - 1) * (j - i - 2) / 2);
      y += sin(2 * pi * (t[i] + t[j]) / l / 2) *
           ((n - j + i - 1) * (n - j + i - 2) / 2 -
            (j - i - 1) * (j - i - 2) / 2);
    }
  }
  cout << fixed << setprecision(10)
       << x / (n * (n - 1) * (n - 2) * (n - 3)) * 12 << ' '
       << y / (n * (n - 1) * (n - 2) * (n - 3)) * 12 << endl;
}
