## https://yukicoder.me/problems/no/1385 import math def main(): N, L = map(int, input().split()) T = list(map(int, input().split())) # sin, cosの累積和 f_list = [0] * N g_list = [0] * N f = 0 g = 0 for i in reversed(range(N)): t = (2 * math.pi * T[i]) / L f += math.sin(t) g += math.cos(t) f_list[i] = f g_list[i] = g # 複雑な計算式の累積和 x_cum_list = [0] * N x_cum = 0 xcos_cum_list = [0] * N xcos_cum = 0 xsin_cum_list = [0] * N xsin_cum = 0 ysin_cum_list = [0] * N ysin_cum = 0 ycos_cum_list = [0] * N ycos_cum = 0 for i in reversed(range(N - 1)): f = f_list[i + 1] g = g_list[i + 1] t = (2 * math.pi * T[i]) / L cos_t = math.cos(t) sin_t = math.sin(t) x = f * cos_t - g * sin_t y = (N - 1 - i) - g * cos_t - f * sin_t x_cum += x x_cum_list[i] = x_cum xcos_cum += x * cos_t xcos_cum_list[i] = xcos_cum xsin_cum += x * sin_t xsin_cum_list[i] = xsin_cum ysin_cum += y * sin_t ysin_cum_list[i] = ysin_cum ycos_cum += y * cos_t ycos_cum_list[i] = ycos_cum # cum_value_list = [0] * N for i in reversed(range(N - 2)): t = (2 * math.pi * T[i]) / L cos_t = math.cos(t) sin_t = math.sin(t) value = x_cum_list[i + 1] / 2 value -= xcos_cum_list[i + 1] * cos_t / 2 value -= xsin_cum_list[i + 1] * sin_t / 2 value += ysin_cum_list[i + 1] * cos_t / 2 value -= ycos_cum_list[i + 1] * sin_t / 2 cum_value_list[i] = value ans = (N * (N - 1) * (N - 2)) // 6 answer = 0 for i in range(N): answer += cum_value_list[i] / ans print(answer) if __name__ == "__main__": main()