#include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ggdem=b;i<ggdem;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;

int main(){FIN;
	ll n,l; cin>>n>>l;
	ll t[n];
	fore(i,0,n)cin>>t[i];
	long double x=0,y=0;
	fore(i,0,n){
		fore(j,i+1,n){
			ll ad=j-i-1;
			x+=cos(acos(-1)*(t[i]+t[j]+l)/l)*(ad)+cos(acos(-1)*(t[i]+t[j])/l)*(n-2-ad);
			y+=sin(acos(-1)*(t[i]+t[j]+l)/l)*(ad)+sin(acos(-1)*(t[i]+t[j])/l)*(n-2-ad);
			//cout<<cos(acos(-1)*(t[i]+t[j]+l)/l)<<" "<<sin(acos(-1)*(t[i]+t[j]+l)/l)<<"\n";
		}
	}
	x/=(n*(n-1)*(n-2)/6);
	y/=(n*(n-1)*(n-2)/6);
	cout<<fixed<<setprecision(15)<<x<<" "<<y<<"\n";
	return 0;
}