#include <bits/stdc++.h>
#pragma GCC optimize("O3")
long mod(long a) {
  long long c = a % (long long)(1e9 + 7);
  if (c >= 0) return c;
  return c + (long long)(1e9 + 7);
}
using namespace std;
bool prime_(int n) {
  if (n == 1) {
    return false;
  } else if (n == 2) {
    return true;
  } else {
    for (int i = 2; i <= sqrt(n); i++) {
      if (n % i == 0) {
        return false;
      }
    }
    return true;
  }
}
long long gcd_(long long a, long long b) {
  if (a < b) {
    swap(a, b);
  }
  if (a % b == 0) {
    return b;
  } else {
    return gcd_(b, a % b);
  }
}
long long lcm_(long long x, long long y) { return (x / gcd_(x, y)) * y; }
int main() {
  int n;
  double l;
  cin >> n >> l;
  double t[n];
  for (int i = 0; i < n; i++) {
    cin >> t[i];
  }
  double x = 0, y = 0;
  int all_ = ((n * (n - 1) / 2) * (n - 2)) / 3;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      x += (double)(n - 2) * cos((acos(-1)) * (t[i] + t[j]) / l);
      y += (double)(n - 2) * sin((acos(-1)) * (t[i] + t[j]) / l);
    }
  }
  x /= (double)all_;
  y /= (double)all_;
  cout << fixed << setprecision(10) << x << ' ' << y << endl;
  return 0;
}
