#include <bits/stdc++.h>
using namespace std;
int n, l;
double rd[3005], pre[3005];
double PI = 3.141592653589793;
int main() {
  cin >> n >> l;
  double sum = 0;
  for (int i = 1; i <= n; i++) {
    double k;
    cin >> k;
    rd[i] = k / l * 2 * PI;
  }
  double ansx = 0, ansy = 0;
  sort(rd + 1, rd + n + 1);
  int cnt = 0;
  for (int i = 1; i < n; i++)
    for (int j = i + 1; j <= n; j++) {
      ansx += cos((rd[i] + rd[j]) / 2) * (i - 1 + n - j);
      ansy += sin((rd[i] + rd[j]) / 2) * (i - 1 + n - j);
      ansx += cos((rd[i] + rd[j]) / 2 + PI) * (j - i - 1);
      ansy += sin((rd[i] + rd[j]) / 2 + PI) * (j - i - 1);
      cnt++;
    }
  printf("%.12lf %.12lf", ansx / (n * (n - 1) * (n - 2) / 6),
         ansy / (n * (n - 1) * (n - 2) / 6));
  return 0;
}
