#include <bits/stdc++.h>
#include <complex>

typedef double db;

const int N = 3005;
const db pi = std::acos(-1);

int n, L;
db t[N];

std::complex<db> ans, point[N];

std::complex<db> polar(db theta) {
	return {std::cos(theta), std::sin(theta)};
}

int main() {
	std::ios::sync_with_stdio(0), std::cin.tie(0);
	std::cin >> n >> L;
	for (int i = 0; i < n; ++i)
		std::cin >> t[i], t[i] = t[i] / L * 2 * pi, point[i] = polar(t[i]);
	for (int A = 0; A < n; ++A) {
		std::complex<db> sum(0, 0); int number = 0;
		for (int B = (A + 1) % n; B != A; B = (B + 1) % n) {
			std::complex<db> M = polar((t[A] + t[B]) / 2 + (t[B] > t[A]) * pi);
			ans += (db) number * M + sum * (point[A] - M);
			db a = t[B] - t[A]; if (a < 0) a += 2 * pi;
			++number, sum += polar(a / 2);
		}
	}
	ans /= (n * (n - 1) / 2), ans /= (n - 2);
	std::cout << std::fixed << std::setprecision(18) << ans.real() << ' ' << ans.imag() << '\n';
	return 0;
}