from math import sin, cos, pi n, l = map(int, input().split()) r = 2 * pi / l t = [r * int(i) 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 a_cos += t_cos[i] * i 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)))