#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<cstdlib>
#define LL long long
#define LD long double
using namespace std;
const int NN=3000 +117;
const int MM=10000 +117;
int read(){
	int fl=1,x;char c;
	for(c=getchar();(c<'0'||c>'9')&&c!='-';c=getchar());
	if(c=='-'){fl=-1;c=getchar();}
	for(x=0;c>='0'&&c<='9';c=getchar())
		x=(x<<3)+(x<<1)+c-'0';
	return x*fl;
}
void open(){
	freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
}
void close(){
	fclose(stdin);
	fclose(stdout);
}


int l,n;
int a[NN]={};
const LD pi=3.1415926535897932385;
int main(){
	//open();
	n=read();
	l=read();
	for(int i=1;i<=n;++i){
		a[i]=read();
	}
	LD x=0;
	LD y=0;
	for(int i=1;i<=n;++i){
		for(int j=i+1;j<=n;++j){
			LD rad=(a[i]+a[j])/2.0/l;
			int cnt=n-(j-i+1);
			x+=cos(rad*2*pi)*cnt;
			y+=sin(rad*2*pi)*cnt;
			rad+=1/2.0;
			cnt=j-i-1;
			x+=cos(rad*2*pi)*cnt;
			y+=sin(rad*2*pi)*cnt;
		}
	}
	LD all=(LD)n*(n-1)*(n-2)/6;
	x/=all;
	y/=all;
	printf("%.11Lf %.11Lf\n",x,y);
	close();
	return 0;
}