#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int n, L, a[3005];
struct P {
  double x, y;
} b[3005];
double ansx, ansy;
double Sin(double x) { return sin(pi * x); }
int main() {
  scanf("%d%d", &n, &L);
  for (int i = (int)(1); i <= (int)(n); i++) {
    scanf("%d", &a[i]);
    b[i].x = cos(2 * pi * a[i] / L);
    b[i].y = sin(2 * pi * a[i] / L);
  }
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(i + 1); j <= (int)(n); j++)
      for (int k = (int)(j + 1); k <= (int)(n); k++) {
        double l1 = Sin(1.0 * (a[k] - a[j]) / L);
        double l2 = Sin(1.0 * (a[j] - a[i]) / L);
        double l3 = Sin(1.0 * (a[k] - a[i]) / L);
        double px = b[i].x * l1 + b[j].x * l3 + b[k].x * l2;
        double py = b[i].y * l1 + b[j].y * l3 + b[k].y * l2;
        ansx += px / (l1 + l2 + l3);
        ansy += py / (l1 + l2 + l3);
      }
  ansx /= 1.0 * n * (n - 1) * (n - 2) / 6;
  ansy /= 1.0 * n * (n - 1) * (n - 2) / 6;
  printf("%.10lf %.10lf\n", ansx, ansy);
}
