#include<bits/stdc++.h>
using namespace std;
int n,l,a[3010];
double x,y;
int main(){
	scanf("%d %d",&n,&l);
	for(int i=1;i<=n;++i)scanf("%d",a+i);
	for(int i=1;i<=n;++i)for(int j=i+1;j<=n;++j){
		double arg=M_PI*(1.0*a[i]+a[j]+l)/l,p=1.0*(j-i-1)/(n-2);
		x+=p*cos(arg);y+=p*sin(arg);
		arg=M_PI*(a[i]+a[j])/l,p=1.0-p;
		x+=p*cos(arg);y+=p*sin(arg);
	}x/=n*(n-1);y/=n*(n-1);
	printf("%.15lf %.15lf",x*6,y*6);
}