#include <bits/stdc++.h>
#define rep(i, n) for (rint i = 1; i <= (n); i ++)
#define re0(i, n) for (rint i = 0; i < (int) n; i ++)
#define travel(i, u) for (rint i = head[u]; i; i = e[i].nxt)
#define rint register int
using namespace std;
 
typedef long long lo;
 
template<typename tp> inline void read(tp &x) {
    x = 0; char c = getchar(); int f = 0;
    for (; c < '0' || c > '9'; f |= c == '-', c = getchar());
    for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
    if (f) x = -x;
}
#define db long double
const db pi = acos(-1.);
const int N = 4444;
int n, L; db t[N];

int main(void) {
	read(n); read(L);
	rep (i, n) scanf("%Lf", &t[i]), t[i] = t[i] * 2 * pi / L;
	db X = 0., Y = 0.;
	rep (i, n) rep (j, i - 1) {
		int in = i - j - 1, out = n - 2 - in;
		db per = (t[i] + t[j]) / 2.;
		X += cos(per) * (out - in); Y += sin(per) * (out - in);
	}
	db all = (db) n * (n - 1) * (n - 2) / 6;
	printf("%.10Lf %.10Lf\n", X / all, Y / all);
		
}
