#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
typedef complex<double> CP;
int n, L;
double ang[3005];
int main() {
	scanf("%d%d", &n, &L);
	for (int i = 0; i < n; i++) {
		int x;
		scanf("%d", &x);
		ang[i] = PI * 2.0 * x / L;
	}
	CP ps = 0, ans = 0;
	for (int i = 1; i < n; i++) {
		ps += CP(cos(0.5 * (ang[i - 1] - PI)), sin(0.5 * (ang[i - 1] - PI)));
		for (int j = i + 1; j < n; j++) {
			ans += CP(cos(0.5 * (ang[i] + ang[j])), sin(0.5 * (ang[i] + ang[j]))) * (double)i;
			ans += 2.0 * sin((ang[j] - ang[i]) * 0.25) * ps * CP(cos((ang[i] + ang[j]) * 0.25), sin((ang[i] + ang[j]) * 0.25));
		}
	}
	ans /= (double)(1ll * n * (n - 1) * (n - 2) / 6);
	printf("%.12lf %.12lf\n", ans.real(), ans.imag());
	return 0;
}