n,k = map(int,input().split())
p = list(map(int,input().split()))
sum = 0
for i in range(n):
    p[i] = (1+p[i])/2
    if i<k-1:
        sum += p[i]
    elif i==k-1:
        sum += p[i]
        largest = sum
    else:
        sum = sum + p[i] - p[i-k]
        largest = max(largest,sum)
        
print(largest) 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 sum = 0 sum 0 for i in range(n):
    p[i] = (1+p[i])/2
    if i<k-1:
        sum += p[i]
    elif i==k-1:
        sum += p[i]
        largest = sum
    else:
        sum = sum + p[i] - p[i-k]
        largest = max(largest,sum)
         i range(n) range n p[i] = (1+p[i])/2 p[i] p i (1+p[i])/2 1+p[i] 1 p[i] p i 2 if i<k-1:
        sum += p[i]
    elif i==k-1:
        sum += p[i]
        largest = sum
    else:
        sum = sum + p[i] - p[i-k]
        largest = max(largest,sum)
         i<k-1 i k-1 k 1 sum += p[i] sum p[i] p i elif i==k-1:
        sum += p[i]
        largest = sum
     i==k-1 i k-1 k 1 sum += p[i] sum p[i] p i largest = sum largest sum sum = sum + p[i] - p[i-k] sum sum + p[i] - p[i-k] sum + p[i] sum p[i] p i p[i-k] p i-k i k largest = max(largest,sum) largest max(largest,sum) max largest sum print(largest) print largest k = map(int,input().split()) map(int,input().split()) k n,k = map(int,input().split()) map(int,input().split()) n sum += p[i] p[i] sum sum = 0 0 sum largest = sum sum largest sum = sum + p[i] - p[i-k] sum + p[i] - p[i-k] sum largest = max(largest,sum) max(largest,sum) largest p = list(map(int,input().split())) list(map(int,input().split())) p sum += p[i] p[i] sum
n,k = map(int,input().split())
p = list(map(int,input().split()))
sum = 0
for i in range(n):
    p[i] = (1+p[i])/2
    if i<k-1:
        sum += p[i]
    elif i==k-1:
        sum += p[i]
        largest = sum
    else:
        sum = sum + p[i] - p[i-k]
        largest = max(largest,sum)
        
print(largest)
