#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <string>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <cmath>
#include <cassert>
#include <queue>
#include <bitset>
#include <map>
#include <set>

#define pb push_back
#define mp make_pair
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()

using namespace std;

typedef long long int64;
typedef pair<int, int> ii;
typedef vector<int> vi;

typedef double D;
constexpr int maxn = 3010;

D X[maxn], Y[maxn];
D A[maxn];
D d[maxn][maxn];
//D den[maxn];

int main() {
  int n, l;
  cin >> n >> l;
  //n = 3000;
  //l = 1000000000;
  for (int i = 0; i < n; ++i) {
    //int t;
    cin >> t;
    t = 1000000000 / (n - i) - 1;
    D alpha = 2.0 * M_PI * t / l;
    A[i] = alpha;
    X[i] = cos(alpha);
    Y[i] = sin(alpha);
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j)
      d[i][j] = hypot((double) (X[i] - X[j]), (double) (Y[i] - Y[j]));
  D sx = 0, sy = 0;
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) {
      //cerr << i << " " << j << "\n";
      D dij = d[i][j];
      //D xi = X[i], xj = X[j];
      //D yi = Y[i], yj = Y[j];
      //for (int k = 0; k < n; ++k)
      //  den[k] = dij / (dij + d[i][k] + d[j][k]);
      D* di = d[i];
      D* dj = d[j];
      for (int k = 0; k < n; ++k) {
        D den = dij / (dij + di[k] + dj[k]);
        sx += X[k] * den;
        sy += Y[k] * den;
      }
      D deni = dij / (dij + di[i] + dj[i]);
      D denj = dij / (dij + di[j] + dj[j]);
      sx -= X[i] * deni; sx -= X[j] * denj;
      sy -= Y[i] * deni; sy -= Y[j] * denj;
//      for (int k = j + 1; k < n; ++k) {
//        //cerr << k << "\n";
//        D dik = d[i][k], djk = d[j][k], xkk = X[k], ykk = Y[k];
//        D s = dij + dik + djk;
//        sx += xi * djk / s + xj * dik / s + xkk * dij / s;
//        sy += yi * djk / s + yj * dik / s + ykk * dij / s;
//      }
    }
  D den = (D)n * D(n - 1) * D(n - 2) / 6.0;
  sx /= den;
  sy /= den;
  printf("%.20f %.20f\n", sx, sy);
  return 0;
}