from math import cos,sin,pi n,L = map(int,input().split()) *a, = map(int,input().split()) w = -2*pi/L ans = x = y = v = 0j for j in range(n): x += v y += (j-1)*v*2 v = cos(w*a[j]) + 1j*sin(w*a[j]) ans += (x*(n-2*j)+y)/v print(ans.imag*3/n/(n-1)/(n-2))