#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = 3.14159265358979323846;
mt19937 mt(736);
struct mpnt {
  double x, y;
  mpnt(double x = 0, double y = 0) : x(x), y(y) {}
  mpnt operator+(const mpnt &o) const { return {x + o.x, y + o.y}; }
  mpnt &operator+=(const mpnt &o) {
    x += o.x;
    y += o.y;
    return *this;
  }
  mpnt operator-(const mpnt &o) const { return {x - o.x, y - o.y}; }
  mpnt operator*(double t) const { return {x * t, y * t}; }
  mpnt operator/(double t) const { return {x / t, y / t}; }
};
double len(const mpnt &a) { return sqrt(a.x * a.x + a.y * a.y); }
void solve(istream &cin = std::cin, ostream &cout = std::cout) {
  int n, l;
  cin >> n >> l;
  vector<mpnt> pnt(n);
  for (auto &it : pnt) {
    int t;
    cin >> t;
    auto ang = 2 * pi * t / l;
    it = {cos(ang), sin(ang)};
  }
  mpnt ans;
  vector<vector<double>> dist(n, vector<double>(n));
  for (int i = 0; i < pnt.size(); i++)
    for (int j = i + 1; j < pnt.size(); j++) dist[i][j] = len(pnt[i] - pnt[j]);
  for (int i = 0; i < pnt.size(); i++)
    for (int j = i + 1; j < pnt.size(); j++)
      for (int k = j + 1; k < pnt.size(); k++) {
        auto &A = pnt[i];
        auto &B = pnt[j];
        auto &C = pnt[k];
        auto a = dist[j][k];
        auto b = dist[i][k];
        auto c = dist[i][j];
        ans += (A * a + B * b + C * c) / (a + b + c);
      }
  auto C3 = [](int n) { return n * (n - 1ll) * (n - 2ll) / 6; };
  ans = ans / C3(pnt.size());
  cout << setprecision(20) << ans.x << ' ' << ans.y << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed;
  solve();
  return 0;
}
