#include <bits/stdc++.h>

typedef std::complex <double> C;
const int N = 3054;

int n, L;

int main() {
	int i, arg; double unit; C c, s1(0, 0), s2(0, 0), ret;
	scanf("%d%d", &n, &L), unit = M_PI / L;
	for (i = 1; i <= n; ++i)
		scanf("%d", &arg), c = std::polar(1., unit * arg),
		ret += (double(n - 2 * i) * s1 + 2. * s2) * c, s1 += c, s2 += (double)i * c;
	ret /= n * (n - 1ll) * (n - 2ll) / 6;
	printf("%.12lg %.12lg\n", ret.real(), ret.imag());	
	return 0;
}