#include <bits/stdc++.h>
using namespace std;
uint32_t xor64(void) {
  static uint64_t x = 88172645463325252ULL;
  x = x ^ (x << 13);
  x = x ^ (x >> 7);
  return x = x ^ (x << 17);
}
int main() {
  int N, L;
  cin >> N >> L;
  vector<int> T(N);
  for (int &t : T) cin >> t;
  double pi = acos(-1.0);
  vector<double> Tx(N), Ty(N);
  for (int i = 0; i < N; i++) {
    Tx[i] = cos(2 * pi * T[i] / L);
    Ty[i] = sin(2 * pi * T[i] / L);
  }
  vector<vector<double>> len(N, vector<double>(N));
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++)
      if (i != j) len[i][j] = hypot(Tx[i] - Tx[j], Ty[i] - Ty[j]);
  double Sx = 0;
  double Sy = 0;
  int M = 50000000;
  int m = 0;
  for (int i = 0; i < M; i++) {
    int a = (int)((long long)xor64() % N);
    int b = (int)((long long)xor64() % N);
    int c = (int)((long long)xor64() % N);
    if (a != b && b != c && c != a) {
      double la = len[b][c];
      double lb = len[c][a];
      double lc = len[a][b];
      double sx = Tx[a] * la + Tx[b] * lb + Tx[c] * lc;
      double sy = Ty[a] * la + Ty[b] * lb + Ty[c] * lc;
      Sx += sx / (la + lb + lc);
      Sy += sy / (la + lb + lc);
      m++;
    }
  }
  printf("%.16f %.16f\n", Sx / m, Sy / m);
}
