# coding: utf-8
# 隣接するK個のサイコロの和が大きいものを探す

nk = input().split()
N = int(nk[0])
K = int(nk[1])

Ps = [int(p) for p in input().split()]

# 累積和にしてもいいし、1つずつスライドして求めてもいい気がする

max_sum = sum(Ps[:K])
current_sum = max_sum

# K+1 ~ N-1 までスライドして見ていく
for i in range(K, N):
    current_sum -= Ps[i-K]
    current_sum += Ps[i]

    max_sum = max(max_sum, current_sum)


# 1~pのサイコロの期待値: ((1+p) * p / 2) / p = (1 + p) / 2
ans = 1.0 * (max_sum + K) / 2
print(ans)

 nk = input().split() nk input().split() ().split () input split N = int(nk[0]) N int(nk[0]) int nk[0] nk 0 K = int(nk[1]) K int(nk[1]) int nk[1] nk 1 int(p) for p in input().split() for p in input().split() p input().split() ().split () input split for p in input().split() int(p) int p Ps = [int(p) for p in input().split()] Ps [int(p) for p in input().split()] max_sum = sum(Ps[:K]) max_sum sum(Ps[:K]) sum Ps[:K] Ps :K K current_sum = max_sum current_sum max_sum for i in range(K, N):
    current_sum -= Ps[i-K]
    current_sum += Ps[i]

    max_sum = max(max_sum, current_sum)


# 1~pのサイコロの期待値: ((1+p) * p / 2) / p = (1 + p) / 2 i range(K, N) range K N current_sum -= Ps[i-K] current_sum Ps[i-K] Ps i-K i K current_sum += Ps[i] current_sum Ps[i] Ps i max_sum = max(max_sum, current_sum) max_sum max(max_sum, current_sum) max max_sum current_sum ans = 1.0 * (max_sum + K) / 2 ans 1.0 * (max_sum + K) / 2 1.0 * (max_sum + K) 1.0 max_sum + K max_sum K 2 print(ans) print ans nk = input().split() input().split() nk current_sum += Ps[i] Ps[i] current_sum N = int(nk[0]) int(nk[0]) N K = int(nk[1]) int(nk[1]) K max_sum = sum(Ps[:K]) sum(Ps[:K]) max_sum current_sum -= Ps[i-K] Ps[i-K] current_sum Ps = [int(p) for p in input().split()] [int(p) for p in input().split()] Ps ans = 1.0 * (max_sum + K) / 2 1.0 * (max_sum + K) / 2 ans max_sum = max(max_sum, current_sum) max(max_sum, current_sum) max_sum current_sum = max_sum max_sum current_sum
# coding: utf-8
# 隣接するK個のサイコロの和が大きいものを探す

nk = input().split()
N = int(nk[0])
K = int(nk[1])

Ps = [int(p) for p in input().split()]

# 累積和にしてもいいし、1つずつスライドして求めてもいい気がする

max_sum = sum(Ps[:K])
current_sum = max_sum

# K+1 ~ N-1 までスライドして見ていく
for i in range(K, N):
    current_sum -= Ps[i-K]
    current_sum += Ps[i]

    max_sum = max(max_sum, current_sum)


# 1~pのサイコロの期待値: ((1+p) * p / 2) / p = (1 + p) / 2
ans = 1.0 * (max_sum + K) / 2
print(ans)


