#include <bits/stdc++.h>
using namespace std;
const long long N = 3007;
struct Point {
  double x, y;
  void operator+=(Point p) {
    x += p.x;
    y += p.y;
  }
  void operator/=(long long t) {
    x /= t;
    y /= t;
  }
};
double dist(Point a, Point b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
Point center(Point A, Point B, Point C) {
  double a = dist(B, C);
  double b = dist(A, C);
  double c = dist(A, B);
  return {(a * A.x + b * B.x + c * C.x) / (a + b + c),
          (a * A.y + b * B.y + c * C.y) / (a + b + c)};
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  long long n, L;
  cin >> n >> L;
  vector<Point> a(n);
  double PI = acos(-1);
  for (long long i = 0; i < n; ++i) {
    long long t;
    cin >> t;
    a[i] = {cos(2 * PI * t / L), sin(2 * PI * t / L)};
  }
  Point ans = {0, 0};
  long long cnt = 0;
  for (long long i = 0; i < n; ++i) {
    for (long long j = i + 1; j < n; ++j) {
      for (long long k = j + 1; k < n; ++k) {
        ans += center(a[i], a[j], a[k]);
        ++cnt;
      }
    }
  }
  ans /= cnt;
  cout << ans.x << ' ' << ans.y << '\n';
}
