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