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
right = 0
#sumz = [0.0]*(N+1)
# #累積和
# 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)
#
sumz = 0.0
for left in range(0, N):
    if right <= left: right = left+1
    while right <= N and right - left <= K:
        x = dice[right-1]
        if ave[x] <= 0.000001:
            ave[x] = (x+1)/2.0
        sumz += ave[x]
        right += 1

    if ans < sumz:
        ans = sumz

    sumz -= ave[dice[left]]

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 right = 0 right 0 sumz = 0.0 sumz 0.0 for left in range(0, N):
    if right <= left: right = left+1
    while right <= N and right - left <= K:
        x = dice[right-1]
        if ave[x] <= 0.000001:
            ave[x] = (x+1)/2.0
        sumz += ave[x]
        right += 1

    if ans < sumz:
        ans = sumz

    sumz -= ave[dice[left]] left range(0, N) range 0 N if right <= left: right = left+1
     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 += ave[x]
        right += 1

     right <= N and right - left <= K right <= N right N right - left <= K right - left right left K x = dice[right-1] x dice[right-1] dice right-1 right 1 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 += ave[x] sumz ave[x] ave x right += 1 right 1 if ans < sumz:
        ans = sumz

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

    if ans < sumz:
        ans = sumz

    sumz -= ave[dice[left]]

print(ans)
