#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353, MAX = 205, INF = 1 << 29;
int main() {
  int N;
  cin >> N;
  double L;
  cin >> L;
  vector<double> A(N), X(N), Y(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    X[i] = cos(M_PI * 2.0 * A[i] / L);
    Y[i] = sin(M_PI * 2.0 * A[i] / L);
  }
  vector<vector<double>> dis(N, vector<double>(N));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      dis[i][j] = hypot(X[i] - X[j], Y[i] - Y[j]);
    }
  }
  double xsum = 0.0, ysum = 0.0;
  for (int a = 0; a < N; a++) {
    for (int b = a + 1; b < N; b++) {
      for (int c = b + 1; c < N; c++) {
        double x =
            X[a] + ((X[c] - X[a]) * dis[a][b] + (X[b] - X[a]) * dis[a][c]) /
                       (dis[a][b] + dis[b][c] + dis[c][a]);
        double y =
            Y[a] + ((Y[c] - Y[a]) * dis[a][b] + (Y[b] - Y[a]) * dis[a][c]) /
                       (dis[a][b] + dis[b][c] + dis[c][a]);
        xsum += x;
        ysum += y;
      }
    }
  }
  cout << setprecision(25)
       << xsum * 6.0 / double(N) / double(N - 1) / double(N - 2) << " ";
  cout << setprecision(25)
       << ysum * 6.0 / double(N) / double(N - 1) / double(N - 2) << "\n";
}
