import numpy as np from numpy.fft import rfft, irfft from math import pi n, l = map(int, input().split()) t = np.array(list(map(int, input().split()))) * (2*pi/l) sin = np.sin(t) cos = np.cos(t) x = irfft(rfft(cos)*rfft(sin)) * np.arange(n) print(np.sum(x)*0+0.5)