#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007;
using ll = long long;
using ld = long double;
using namespace std;

const ld pi = acos(-1);

int main(){
	int n, l; cin >> n >> l;
	vector<int> t(n);
	for( auto &k : t ) cin >> k;
	ld ccx = 0; 
	ld ccy = 0;
	for( int i = 0; i < n; ++i ){
		for( int j = i+1; j < n; ++j ){
			ld theta = pi*(t[i]+t[j])/l;
			int an = j-i-1;
			ccx += cos(theta)*(n-2-an);
			ccy += sin(theta)*(n-2-an);
			ccx -= cos(theta)*an;
			ccy -= sin(theta)*an;
		}
	}
	cout << fixed << setprecision(21) << ccx*6/n/(n-1)/(n-2) << ' ' << ccy*6/n/(n-1)/(n-2) << endl;
}