#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
const long double pi=3.1415926535897932384626433832795;
int n,l,t[3030];
long double sumx,sumy,x,y;
int main()
{
	scanf("%d %d",&n,&l);
	for(int i=1;i<=n;++i)scanf("%d",&t[i]);
	int cnt;
	for(int i=1;i<=n;++i)
	{
		cnt=-1;
		for(int j=i+1;j<=n;++j)
		{
			++cnt;
			x=cos(pi*(t[i]+t[j])/l);
			y=sin(pi*(t[i]+t[j])/l);
			sumx+=(n-cnt-2-cnt)*x;
			sumy+=(n-cnt-2-cnt)*y;
		}
	}
	sumx=sumx*6/n/(n-1)/(n-2);
	sumy=sumy*6/n/(n-1)/(n-2);
	printf("%.15Lf %.15Lf",sumx,sumy);
	return 0;
}
