#include <bits/stdc++.h>

typedef long long int int64;
using ld = long double;
ld point[3003];
int n,l;
int main()
{
	scanf("%d%d",&n,&l);
	for(int i = 0;i < n;++i) {
		int t;
		scanf("%d",&t);
		point[i] = (ld)t / (ld)l;
	}
	std::sort(point,point+n);
	ld ansx = 0, ansy = 0;
	for(int i = 0;i < n;++i) {
		for(int j = i+1;j < n;++j) {
			double pa = (point[i]+point[j])/2., pb = (point[i]+point[j]+1)/2.;
			int ca = j-i-1, cb = n-ca-2;
			ansx += cos(2*M_PI*pa)*cb;ansy += sin(2*M_PI*pa)*cb;
			ansx += cos(2*M_PI*pb)*ca;ansy += sin(2*M_PI*pb)*ca;
		}
	}
	ansx /= (int64)n*(n-1)*(n-2)/6;
	ansy /= (int64)n*(n-1)*(n-2)/6;
	printf("%.18Lf %.18Lf\n", ansx, ansy);
}
