#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, l;
  cin >> n >> l;
  vector<long long int> v;
  for (long long int i = 0; i < n; i++) {
    long long int in;
    cin >> in;
    v.push_back(in);
  }
  long double x = 0;
  long double y = 0;
  long long int cnt = 0;
  for (long long int a = 0; a < n; a++) {
    long double ax = cosl(2.00L * M_PI * v[a] / l);
    long double ay = sinl(2.00L * M_PI * v[a] / l);
    for (long long int b = a + 1; b < n; b++) {
      long double bx = cosl(2.00L * M_PI * v[b] / l);
      long double by = sinl(2.00L * M_PI * v[b] / l);
      for (long long int c = b + 1; c < n; c++) {
        long double cx = cosl(2.00L * M_PI * v[c] / l);
        long double cy = sinl(2.00L * M_PI * v[c] / l);
        long double xx = ax - bx;
        long double yy = ay - by;
        long double cd = sqrtl(xx * xx + yy * yy);
        xx = bx - cx;
        yy = by - cy;
        long double ad = sqrtl(xx * xx + yy * yy);
        xx = cx - ax;
        yy = cy - ay;
        long double bd = sqrtl(xx * xx + yy * yy);
        x += (ad * ax + bd * bx + cd * cx) / (ad + bd + cd);
        y += (ad * ay + bd * by + cd * cy) / (ad + bd + cd);
        cnt++;
      }
    }
  }
  cout << fixed << setprecision(10) << x / cnt << " " << y / cnt << endl;
  return 0;
}
