#include <bits/stdc++.h>
using namespace std;
pair<double, double> inner_center(double Ax, double Ay, double Bx, double By,
                                  double Cx, double Cy) {
  double a = hypot(Bx - Cx, By - Cy), b = hypot(Cx - Ax, Cy - Ay),
         c = hypot(Ax - Bx, Ay - By);
  double atbtc = a + b + c;
  return pair<double, double>((a * Ax + b * Bx + c * Cx) / atbtc,
                              (a * Ay + b * By + c * Cy) / atbtc);
}
int main() {
  int N, i, j, k;
  double L;
  scanf("%d%lf", &N, &L);
  vector<double> T(N);
  for (i = 0; i < N; i++) {
    scanf("%lf", &T[i]);
  }
  double ZPi_L = 2 * M_PI / L;
  double sumx = 0, sumy = 0;
  int count = 0;
  for (i = 0; i < N; i++) {
    for (j = i + 1; j < N; j++) {
      for (k = j + 1; k < N; k++) {
        count++;
        sumx += inner_center(cos(ZPi_L * T[i]), sin(ZPi_L * T[i]),
                             cos(ZPi_L * T[j]), sin(ZPi_L * T[j]),
                             cos(ZPi_L * T[k]), sin(ZPi_L * T[k]))
                    .first;
        sumy += inner_center(cos(ZPi_L * T[i]), sin(ZPi_L * T[i]),
                             cos(ZPi_L * T[j]), sin(ZPi_L * T[j]),
                             cos(ZPi_L * T[k]), sin(ZPi_L * T[k]))
                    .second;
      }
    }
  }
  printf("%.10lf %10lf\n", sumx / count, sumy / count);
  return 0;
}
