#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  long L;
  cin >> N >> L;
  double T[N];
  for (int i = 0; i < N; i++) {
    cin >> T[i];
  }
  double X = 0;
  double Y = 0;
  int cnt = 0;
  for (int i = 0; i < N - 2; i++) {
    double x1 = cos(2 * 3.14159265359 * T[i] / L);
    double y1 = sin(2 * 3.14159265359 * T[i] / L);
    for (int j = i + 1; j < N - 1; j++) {
      double x2 = cos(2 * 3.14159265359 * T[j] / L);
      double y2 = sin(2 * 3.14159265359 * T[j] / L);
      double c = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
      for (int k = j + 1; k < N; k++) {
        double x3 = cos(2 * 3.14159265359 * T[k] / L);
        double y3 = sin(2 * 3.14159265359 * T[k] / L);
        double a = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
        double b = sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3));
        X += (a * x1 + b * x2 + c * x3) / (a + b + c);
        Y += (a * y1 + b * y2 + c * y3) / (a + b + c);
        cnt++;
      }
    }
  }
  cout << std::setprecision(10) << X / cnt << " " << Y / cnt << endl;
}
