#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
double dist(double x1, double y1, double x2, double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
int main() {
  int n, l;
  cin >> n >> l;
  vector<double> x(n), y(n);
  for (int i = (0); i < (n); ++i) {
    int t;
    cin >> t;
    x[i] = cos(2.0 * M_PI * t / l);
    y[i] = sin(2.0 * M_PI * t / l);
  }
  long long total = (long long)n * (n - 1) * (n - 2) / 6;
  double ans_x = 0, ans_y = 0;
  for (int i = (0); i < (n); ++i)
    for (int j = (i + 1); j < (n); ++j)
      for (int k = (j + 1); k < (n); ++k) {
        double a = dist(x[i], y[i], x[j], y[j]),
               b = dist(x[j], y[j], x[k], y[k]),
               c = dist(x[k], y[k], x[i], y[i]);
        double p = a + b + c;
        ans_x += (a * x[k] + b * x[i] + c * x[j]) / p / total;
        ans_y += (a * y[k] + b * y[i] + c * y[j]) / p / total;
      }
  printf("%.10f %.10f\n", ans_x, ans_y);
  return 0;
}
