from math import sin, cos, pi n, l = map(int, input().split()) t = [2*pi * int(i) / l for i in input().split()] t.sort() s_sin = 0 s_cos = 0 for i in range(n): s_sin += sin(t[i]) * (i-1) s_cos += cos(t[i]) * (i-1) t_sin = 0 t_cos = 0 for i in range(n): t_sin += sin(t[i]) t_cos += cos(t[i]) ans = 0 xx = 0 for i in range(n): ans += sin(t[i]) * s_cos - cos(t[i]) * s_sin s_sin += n * sin(t[i]) - t_sin s_cos += n * cos(t[i]) - t_cos print(ans * 3 / (n*(n-1)*(n-2)))