#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = 3.1415926535;
void Main() {
  ll N, L;
  cin >> N >> L;
  vector<double> T(N);
  vector<double> X(N);
  vector<double> Y(N);
  for (ll i = 0; i < (N); ++i) {
    int a;
    cin >> a;
    double t = 2 * pi * (double)a / L;
    T[i] = t;
    X[i] = cos(t);
    Y[i] = sin(t);
  }
  vector<vector<double>> R(N, vector<double>(N, 0));
  for (ll i = 0; i < (N); ++i)
    for (ll j = 0; j < (N); ++j) {
      if (i < j) {
        R[i][j] = 2 * sin((T[j] - T[i]) / 2.0);
      }
    }
  double x = 0, y = 0;
  double combi = N * (N - 1) * (N - 2) / 6.0;
  for (ll i = 0; i < (N - 2); ++i)
    for (int j = i + 1; j < N - 1; ++j)
      for (int k = j + 1; k < N; ++k) {
        double bunbo = R[j][k] + R[i][k] + R[i][j];
        x += (R[j][k] * X[i] + R[i][k] * X[j] + R[i][j] * X[k]) / bunbo;
        y += (R[j][k] * Y[i] + R[i][k] * Y[j] + R[i][j] * Y[k]) / bunbo;
      }
  x /= combi;
  y /= combi;
  cout << x << " " << y << endl;
}
int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}
