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

#dice.sort(reverse=True)
MAXX = 1001
ave = [0.0]*MAXX

ans = 0.0
sumz = [0.0]*(N+1)
right = 0
#累積和
for i in range(N):
    x = dice[i]
    if ave[x] <= 0.000001:
        ave[x] = (x + 1) / 2.0
    sumz[i+1] = sumz[i]+ ave[x]

#find max
for i in range(K, N+1):
    if ans < sumz[i] - sumz[i-K]:
        ans = sumz[i] - sumz[i-K]

print(ans)
#
# for left in range(0, N):
#     if right <= left: right = left
#     while right < N and right - left <= K:
#         x = dice[right-1]
#         if ave[x] <= 0.000001:
#             ave[x] = (x+1)/2.0
#         sumz[right] = sumz[right-1] + ave[x]
#         right += 1
#
#     if ans < sumz[right-1]:
#         ans = sumz[right-1]
#
# print(ans)
#
#
#
#
#
# print(ans) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K dice = list(map(int, input().split())) dice list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split MAXX = 1001 MAXX 1001 ave = [0.0]*MAXX ave [0.0]*MAXX [0.0] 0.0 MAXX ans = 0.0 ans 0.0 sumz = [0.0]*(N+1) sumz [0.0]*(N+1) [0.0] 0.0 N+1 N 1 right = 0 right 0 for i in range(N):
    x = dice[i]
    if ave[x] <= 0.000001:
        ave[x] = (x + 1) / 2.0
    sumz[i+1] = sumz[i]+ ave[x]

#find max i range(N) range N x = dice[i] x dice[i] dice i if ave[x] <= 0.000001:
        ave[x] = (x + 1) / 2.0
     ave[x] <= 0.000001 ave[x] ave x 0.000001 ave[x] = (x + 1) / 2.0 ave[x] ave x (x + 1) / 2.0 x + 1 x 1 2.0 sumz[i+1] = sumz[i]+ ave[x] sumz[i+1] sumz i+1 i 1 sumz[i]+ ave[x] sumz[i] sumz i ave[x] ave x for i in range(K, N+1):
    if ans < sumz[i] - sumz[i-K]:
        ans = sumz[i] - sumz[i-K] i range(K, N+1) range K N+1 N 1 if ans < sumz[i] - sumz[i-K]:
        ans = sumz[i] - sumz[i-K] ans < sumz[i] - sumz[i-K] ans sumz[i] - sumz[i-K] sumz[i] sumz i sumz[i-K] sumz i-K i K ans = sumz[i] - sumz[i-K] ans sumz[i] - sumz[i-K] sumz[i] sumz i sumz[i-K] sumz i-K i K print(ans) print ans ans = sumz[i] - sumz[i-K] sumz[i] - sumz[i-K] ans ave = [0.0]*MAXX [0.0]*MAXX ave ans = 0.0 0.0 ans sumz = [0.0]*(N+1) [0.0]*(N+1) sumz x = dice[i] dice[i] x N, K = map(int, input().split()) map(int, input().split()) N dice = list(map(int, input().split())) list(map(int, input().split())) dice K = map(int, input().split()) map(int, input().split()) K right = 0 0 right MAXX = 1001 1001 MAXX
N, K = map(int, input().split())
dice = list(map(int, input().split()))

#dice.sort(reverse=True)
MAXX = 1001
ave = [0.0]*MAXX

ans = 0.0
sumz = [0.0]*(N+1)
right = 0
#累積和
for i in range(N):
    x = dice[i]
    if ave[x] <= 0.000001:
        ave[x] = (x + 1) / 2.0
    sumz[i+1] = sumz[i]+ ave[x]

#find max
for i in range(K, N+1):
    if ans < sumz[i] - sumz[i-K]:
        ans = sumz[i] - sumz[i-K]

print(ans)
#
# for left in range(0, N):
#     if right <= left: right = left
#     while right < N and right - left <= K:
#         x = dice[right-1]
#         if ave[x] <= 0.000001:
#             ave[x] = (x+1)/2.0
#         sumz[right] = sumz[right-1] + ave[x]
#         right += 1
#
#     if ans < sumz[right-1]:
#         ans = sumz[right-1]
#
# print(ans)
#
#
#
#
#
# print(ans)
