import numpy as np

n, k = list(map(int, input().split()))

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



"""

各pの期待値を算出

p期待値について累積和を出す

最大部分和を出す

"""



p_ex = [0] * n



for i in range(n):

    p_ex[i] = (1 + p[i])/2

p_ruiseki = np.cumsum(p_ex)



maxsum = p_ruiseki[k-1]

for i in range(k, n):

    if maxsum < p_ruiseki[i] - p_ruiseki[i-k]:

        maxsum = p_ruiseki[i] - p_ruiseki[i-k]

print(maxsum)



# ruiseki_p = np.cumsum(p)

# maxsum = ruiseki_p[k-1]

# maxindex = -1



# for i in range(k, n):

#     if maxsum < ruiseki_p[i] - ruiseki_p[i-k]:

#         maxsum = ruiseki_p[i] - ruiseki_p[i-k]

#         maxindex = i



# # print(maxsum)

# # print(maxindex)

# # print("---------------")



# ans = 0

# div = 1

# hoge = [[]] * k



# for i in range(k):

#     div *= p[maxindex - i]

#     # print(p[maxindex - i])

#     for j in range(p[maxindex - i]):

#         hoge[i].append(j)





# # print(div)

# # print(hoge)

# print("---------------")





# for i in range(1, p[maxindex-2]+1):

#     for j in range(1, p[maxindex-1]+1):

#         for k in range(1, p[maxindex]+1):

#             ans += (i + j + k) / div

# print(ans)



# # a = [1,2]

# # b = [1,2,3,4]

# # c = [1,2,3,4,5]

# # ex = 0



# # for i in range(2):

# #     for j in range(4):

# #         for k in range(5):

# #             ex += (a[i] + b[j] + c[k])/40



# # print(ex)
n, k = list(map(int, input().split()))

P = list(map(int, input().split()))

ans = 0

E = []



for p in P:

    E.append(p*(p+1)/(2*p))



cumsumE = [0]

for e in E:

    cumsumE.append(cumsumE[-1] + e)



for i in range(0, n+1-k):

    ans = max(ans, cumsumE[i+k]-cumsumE[i])

print(ans)
import numpy as np

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
"""
各pの期待値を算出
p期待値について累積和を出す
最大部分和を出す
"""
p_ex = [0] * n
for i in range(n):
    p_ex[i] = (1 + p[i]) / 2
p_ruiseki = np.cumsum(p_ex)
maxsum = p_ruiseki[k - 1]
for i in range(k, n):
    if maxsum < p_ruiseki[i] - p_ruiseki[i - k]:
        maxsum = p_ruiseki[i] - p_ruiseki[i - k]
print(maxsum)
# ruiseki_p = np.cumsum(p)
# maxsum = ruiseki_p[k-1]
# maxindex = -1
# for i in range(k, n):
#     if maxsum < ruiseki_p[i] - ruiseki_p[i-k]:
#         maxsum = ruiseki_p[i] - ruiseki_p[i-k]
#         maxindex = i
# # print(maxsum)
# # print(maxindex)
# # print("---------------")
# ans = 0
# div = 1
# hoge = [[]] * k
# for i in range(k):
#     div *= p[maxindex - i]
#     # print(p[maxindex - i])
#     for j in range(p[maxindex - i]):
#         hoge[i].append(j)
# # print(div)
# # print(hoge)
# print("---------------")
# for i in range(1, p[maxindex-2]+1):
#     for j in range(1, p[maxindex-1]+1):
#         for k in range(1, p[maxindex]+1):
#             ans += (i + j + k) / div
# print(ans)
# # a = [1,2]
# # b = [1,2,3,4]
# # c = [1,2,3,4,5]
# # ex = 0
# # for i in range(2):
# #     for j in range(4):
# #         for k in range(5):
# #             ex += (a[i] + b[j] + c[k])/40
# # print(ex)

n, k = list(map(int, input().split()))
P = list(map(int, input().split()))
ans = 0
E = []
for p in P:
    E.append(p * (p + 1) / (2 * p))
cumsumE = [0]
for e in E:
    cumsumE.append(cumsumE[-1] + e)
for i in range(0, n + 1 - k):
    ans = max(ans, cumsumE[i + k] - cumsumE[i])
print(ans)

-import numpy as np - -p = list(map(int, input().split())) -""" -各pの期待値を算出 -p期待値について累積和を出す -最大部分和を出す -""" -p_ex = [0] * n -for i in range(n): -    p_ex[i] = (1 + p[i]) / 2 -p_ruiseki = np.cumsum(p_ex) -maxsum = p_ruiseki[k - 1] -for i in range(k, n): -    if maxsum < p_ruiseki[i] - p_ruiseki[i - k]: -        maxsum = p_ruiseki[i] - p_ruiseki[i - k] -print(maxsum) -# ruiseki_p = np.cumsum(p) -# maxsum = ruiseki_p[k-1] -# maxindex = -1 -# for i in range(k, n): -#     if maxsum < ruiseki_p[i] - ruiseki_p[i-k]: -#         maxsum = ruiseki_p[i] - ruiseki_p[i-k] -#         maxindex = i -# # print(maxsum) -# # print(maxindex) -# ans = 0 -# div = 1 -# hoge = [[]] * k -# for i in range(k): -#     div *= p[maxindex - i] -#     # print(p[maxindex - i]) -#     for j in range(p[maxindex - i]): -#         hoge[i].append(j) -# # print(div) -# # print(hoge) -# for i in range(1, p[maxindex-2]+1): -#     for j in range(1, p[maxindex-1]+1): -#         for k in range(1, p[maxindex]+1): -#             ans += (i + j + k) / div -# print(ans) -# # a = [1,2] -# # b = [1,2,3,4] -# # c = [1,2,3,4,5] -# # ex = 0 -# # for i in range(2): -# #     for j in range(4): -# #         for k in range(5): -# #             ex += (a[i] + b[j] + c[k])/40 -# # print(ex) +P = list(map(int, input().split())) +ans = 0 +E = [] +for p in P: +    E.append(p * (p + 1) / (2 * p)) +cumsumE = [0] +for e in E: +    cumsumE.append(cumsumE[-1] + e) +for i in range(0, n + 1 - k): +    ans = max(ans, cumsumE[i + k] - cumsumE[i]) +print(ans)