#include<bits/stdc++.h>
#define lb long double
#define ll long long
#define N 3010
#define pi acos(-1)
using namespace std;
struct Po{lb x,y;}ans,y,x;
Po operator +(Po x,Po y){return (Po){x.x+y.x,x.y+y.y};}
Po operator -(Po x,Po y){return (Po){x.x-y.x,x.y-y.y};}
Po operator *(Po x,lb y){return (Po){x.x*y,x.y*y};}
Po operator *(Po x,Po y){return (Po){x.x*y.x-x.y*y.y,x.x*y.y+x.y*y.x};}
Po operator /(Po x,lb y){return (Po){x.x/y,x.y/y};}
ll s[N],a[N],n,l;
Po que(lb x){return (Po){cosl(2*pi*x/l),sinl(2*pi*x/l)};}
int main(){
	cin>>n>>l;
	for (int i=1;i<=n;i++)cin>>a[i];
	for (int i=n;i>=1;i--)s[i]=s[i+1]+a[i];
	for (int i=1;i<n;i++){
		y=(Po){0,0};
		for (int j=n-1;j>i;j--){
			Po x=que((a[i]+a[j])/2.0);y=y+que((a[j+1]+l-a[i])/2.0);
			ans=ans+x*(n-j)+(que(a[i])-x)*y;
		}
	}
	ans=ans/n/(n-1)/(n-2)*6;
	printf("%.15Lf %.15Lf",ans.x,ans.y);
	return 0;
}