#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, const pair<S, T> p) {
  out << "(" << p.first << "," << p.second << ")";
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  for (auto a : v) out << a << " ";
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, const set<T>& S) {
  for (auto a : S) cout << a << " ";
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, const multiset<T>& S) {
  for (auto a : S) cout << a << " ";
  return out;
}
template <typename S, typename T>
ostream& operator<<(ostream& out, const map<S, T>& M) {
  for (auto m : M) cout << "(" << m.first << "->" << m.second << ") ";
  return out;
}
template <typename S, typename T>
pair<S, T> operator+(pair<S, T> a, pair<S, T> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
template <typename S, typename T>
pair<S, T> operator-(pair<S, T> a, pair<S, T> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
using point = complex<long double>;
const long double PI = acos(-1.0);
random_device rd;
uniform_int_distribution<int> dist(0, 1e9);
point query_incenter(point a, point b, point c) {
  long double A = abs(b - c);
  long double B = abs(c - a);
  long double C = abs(a - b);
  point p = a * polar(A, 0.0L) + b * polar(B, 0.0L) + c * polar(C, 0.0L);
  p = p / polar(A + B + C, 0.0L);
  return p;
}
point solve(vector<point>& A) {
  int n = A.size();
  long double cnt = 0.0l;
  point ans(0.0L, 0.0);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int k = j + 1; k < n; k++) {
        ans = ans + query_incenter(A[i], A[j], A[k]);
        cnt++;
      }
    }
  }
  ans = ans / polar(cnt, 0.0L);
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, L;
  vector<point> A;
  cin >> n >> L;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    A.push_back(polar(1.0L, 2 * PI / L * a));
  }
  point ans = solve(A);
  cout << fixed << setprecision(15) << ans.real() << " " << ans.imag() << endl;
  return 0;
}
