n,L = map(int,input().split()) *a, = map(int,input().split()) from math import cos,sin,exp,pi from itertools import accumulate sisuu = [cos(-2*pi/L*ai) + 1j*sin(-2*pi/L*ai) for ai in a] acc = [0j]+sisuu[:] for i in range(1,n+1): acc[i] += acc[i-1] acc2 = [0j]+[i*(cos(-2*pi/L*a[i]) + i*1j*sin(-2*pi/L*a[i])) for i in range(n)] for i in range(1,n+1): acc2[i] += acc2[i-1] #print(sisuu) #print(acc) #print(acc2) ans = 0j for j in range(1,n): x = acc[i]*(n-2*j) y = acc2[i]*2 ans += (x+y)/sisuu[j] p = 3/n/(n-1)/(n-2) print(abs(ans)/p) """ ans = 0 from math import sin,pi for i in range(n): for j in range(i+1,n): ans += (n-2-2*(j-i-1))*sin((a[j]-a[i])*2*pi/L) p = 3/n/(n-1)/(n-2) print(ans) """