#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
const long long int MOD = 1e9 + 7;
const long long int LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI = acos(-1.0);
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
signed main() {
  int n, l;
  cin >> n >> l;
  vector<double> t(n);
  for (int i = 0; i < (int)(n); i++) cin >> t[i];
  t.push_back(t[0] + l);
  double sa[n];
  for (int i = 0; i < (int)(n); i++)
    sa[i] = (t[i + 1] + t[i]) / 2, cerr << sa[i] << endl;
  double x = 0, y = 0;
  for (int i = 0; i < (int)(n); i++) {
    x += cos(2.0 * sa[i] * PI / (1.0 * l));
    y += sin(2.0 * sa[i] * PI / (1.0 * l));
  }
  cout << x / (1.0 * (n - 2)) << " " << y / (1.0 * (n - 2)) << endl;
  return 0;
}
