#include using namespace std; const double PI = acos(-1); int main(){ cout << fixed << setprecision(20); int N; long long L; cin >> N >> L; vector T(N); for (int i = 0; i < N; i++){ cin >> T[i]; } vector t(N); for (int i = 0; i < N; i++){ t[i] = (double) T[i] / L; } double sum = 0; long long cnt = 0; for (int i = 0; i < N; i++){ for (int j = 0; j < N; j++){ if (i != j){ int m = N - 1 - (j + N - i) % N; sum += sin((t[j] - t[i]) * 2 * PI) / 2 * m; cnt += m; } } } sum /= cnt; sum *= 3; cout << sum << endl; }