N, K = map(int, input().split())
p = list(map(int, input().split()))

# サイコロ（1...p）の期待値は(1+p)/2
cum_sum = [0]
for i in range(0, N):
    cum_sum.append(cum_sum[i] + (1 + p[i]) / 2)
# print(cum_sum)
# 調べる区間は[1,...,K],...,[N-K+1,...N]
ans = 0
for i in range(1, N - K + 2):
    temp = cum_sum[i + K - 1] - cum_sum[i - 1]
    # print(temp)
    ans = max(ans, temp)
print(ans) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K p = list(map(int, input().split())) p list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split cum_sum = [0] cum_sum [0] 0 for i in range(0, N):
    cum_sum.append(cum_sum[i] + (1 + p[i]) / 2)
# print(cum_sum)
# 調べる区間は[1,...,K],...,[N-K+1,...N] i range(0, N) range 0 N cum_sum.append(cum_sum[i] + (1 + p[i]) / 2) cum_sum.append cum_sum append cum_sum[i] + (1 + p[i]) / 2 cum_sum[i] cum_sum i (1 + p[i]) / 2 1 + p[i] 1 p[i] p i 2 ans = 0 ans 0 for i in range(1, N - K + 2):
    temp = cum_sum[i + K - 1] - cum_sum[i - 1]
    # print(temp)
    ans = max(ans, temp) i range(1, N - K + 2) range 1 N - K + 2 N - K N K 2 temp = cum_sum[i + K - 1] - cum_sum[i - 1] temp cum_sum[i + K - 1] - cum_sum[i - 1] cum_sum[i + K - 1] cum_sum i + K - 1 i + K i K 1 cum_sum[i - 1] cum_sum i - 1 i 1 ans = max(ans, temp) ans max(ans, temp) max ans temp print(ans) print ans cum_sum = [0] [0] cum_sum temp = cum_sum[i + K - 1] - cum_sum[i - 1] cum_sum[i + K - 1] - cum_sum[i - 1] temp ans = max(ans, temp) max(ans, temp) ans K = map(int, input().split()) map(int, input().split()) K ans = 0 0 ans N, K = map(int, input().split()) map(int, input().split()) N p = list(map(int, input().split())) list(map(int, input().split())) p
N, K = map(int, input().split())
p = list(map(int, input().split()))

# サイコロ（1...p）の期待値は(1+p)/2
cum_sum = [0]
for i in range(0, N):
    cum_sum.append(cum_sum[i] + (1 + p[i]) / 2)
# print(cum_sum)
# 調べる区間は[1,...,K],...,[N-K+1,...N]
ans = 0
for i in range(1, N - K + 2):
    temp = cum_sum[i + K - 1] - cum_sum[i - 1]
    # print(temp)
    ans = max(ans, temp)
print(ans)
