#include <bits/stdc++.h>
using namespace std;
using vint = vector<long long>;
using vvint = vector<vint>;
using pint = pair<long long, long long>;
constexpr long double pi = 3.1415926535897932384626433832795028;
constexpr long long dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr long long dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
template <typename T>
using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
template <typename T1, typename T2>
inline bool chmax(T1 &a, const T2 &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T1, typename T2>
inline bool chmin(T1 &a, const T2 &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &p) {
  os << "{";
  for (auto itr = p.begin(); itr != p.end(); itr++) {
    itr++;
    if (itr != p.end()) {
      os << ", ";
    }
    itr--;
  }
  os << "}";
  return os;
}
struct SetUp {
  static constexpr long long PREC = 20;
  SetUp() {
    cout << fixed << setprecision(PREC);
    cerr << fixed << setprecision(PREC);
  };
} setUp;
long long N, L;
long double T[3300];
long double dist(pair<long double, long double> p1,
                 pair<long double, long double> p2) {
  return sqrt((p1.first - p2.first) * (p1.first - p2.first) +
              (p1.second - p2.second) * (p1.second - p2.second));
}
signed main() {
  cin >> N >> L;
  for (long long i = 0; i < (long long)N; i++) {
    cin >> T[i];
  }
  if (N < 500) {
    long double x = 0, y = 0;
    long long c = 0;
    for (long long i = 0; i < (long long)N; i++) {
      for (long long j = 0; j < (long long)i; j++) {
        for (long long k = 0; k < (long long)j; k++) {
          pair<long double, long double> p1 = {cos(2 * pi * T[i] / L),
                                               sin(2 * pi * T[i] / L)};
          pair<long double, long double> p2 = {cos(2 * pi * T[j] / L),
                                               sin(2 * pi * T[j] / L)};
          pair<long double, long double> p3 = {cos(2 * pi * T[k] / L),
                                               sin(2 * pi * T[k] / L)};
          long double sum = dist(p1, p2) + dist(p2, p3) + dist(p3, p1);
          x += p1.first * dist(p2, p3) / sum;
          x += p2.first * dist(p1, p3) / sum;
          x += p3.first * dist(p1, p2) / sum;
          y += p1.second * dist(p2, p3) / sum;
          y += p2.second * dist(p1, p3) / sum;
          y += p3.second * dist(p1, p2) / sum;
          c++;
        }
      }
    }
    cout << x / c << " " << y / c << endl;
  } else {
    long double x = 0, y = 0;
    long long c = 0;
    for (long long i = 0; i < (long long)N; i++) {
      pair<long double, long double> p1 = {cos(2 * pi * T[i] / L),
                                           sin(2 * pi * T[i] / L)};
      x += p1.first;
      y += p1.second;
      c++;
    }
    cout << x / c << " " << y / c << endl;
  }
}
