#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <typename T>
ostream &operator<<(ostream &os, vector<pair<T, T>> &v) {
  int n = v.size();
  for (int i = 0; i < n; i++) os << v[i].first << ' ' << v[i].second << "\n";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  int n = v.size();
  for (int i = 0; i < n; i++) os << v[i] << " ";
  os << '\n';
  return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  int n = v.size();
  for (int i = 0; i < n; i++) is >> v[i];
  return is;
}
long long mod = 1e9 + 7;
const int MAX = 3 * 1e3 + 5;
long double dp[MAX][MAX];
int visited[MAX][MAX] = {};
vector<pair<long double, long double>> pos;
long double distance(int i, int j) {
  if (visited[i][j]) return dp[i][j];
  visited[i][j] = 1;
  pair<long double, long double> a = pos[i], b = pos[j];
  return dp[i][j] = sqrt((a.first - b.first) * (a.first - b.first) +
                         (a.second - b.second) * (a.second - b.second));
}
void solvetestcase() {
  cout << fixed << setprecision(10);
  ;
  int n;
  long double l;
  cin >> n >> l;
  vector<int> v(n);
  cin >> v;
  pos.resize(n);
  for (int i = 0; i < n; i++) {
    pos[i].first = cos((2 * M_PI * v[i]) / l);
    pos[i].second = sin((2 * M_PI * v[i]) / l);
  }
  long long count = 0;
  long double sum_x = 0, sum_y = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int k = j + 1; k < n; k++) {
        long double a, b, c;
        a = distance(j, k);
        b = distance(i, j);
        c = distance(i, k);
        sum_x += (a * pos[i].first + b * pos[k].first + c * pos[j].first) /
                 (a + b + c);
        sum_y += (a * pos[i].second + b * pos[k].second + c * pos[j].second) /
                 (a + b + c);
        count++;
      }
    }
  }
  cout << sum_x / count << " " << sum_y / count << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  for (int T = 1; T < t + 1; T++) {
    solvetestcase();
  }
};
