import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

s = [0] * (n + 1)
for i in range(n):
    a = p[i] * (p[i] + 1) // 2
    e = a / p[i]
    s[i + 1] = s[i] + e

ans = 0
for i in range(n - k + 1):
    ans = max(ans, s[i + k] - s[i])
print('{:.12f}'.format(ans)) import sys sys sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline 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 s = [0] * (n + 1) s [0] * (n + 1) [0] 0 n + 1 n 1 for i in range(n):
    a = p[i] * (p[i] + 1) // 2
    e = a / p[i]
    s[i + 1] = s[i] + e i range(n) range n a = p[i] * (p[i] + 1) // 2 a p[i] * (p[i] + 1) // 2 p[i] * (p[i] + 1) p[i] p i p[i] + 1 p[i] p i 1 2 e = a / p[i] e a / p[i] a p[i] p i s[i + 1] = s[i] + e s[i + 1] s i + 1 i 1 s[i] + e s[i] s i e ans = 0 ans 0 for i in range(n - k + 1):
    ans = max(ans, s[i + k] - s[i]) i range(n - k + 1) range n - k + 1 n - k n k 1 ans = max(ans, s[i + k] - s[i]) ans max(ans, s[i + k] - s[i]) max ans s[i + k] - s[i] s[i + k] s i + k i k s[i] s i print('{:.12f}'.format(ans)) print '{:.12f}'.format(ans) '{:.12f}'.format '{:.12f}' format ans s = [0] * (n + 1) [0] * (n + 1) s a = p[i] * (p[i] + 1) // 2 p[i] * (p[i] + 1) // 2 a ans = max(ans, s[i + k] - s[i]) max(ans, s[i + k] - s[i]) ans input = sys.stdin.readline sys.stdin.readline input n,k = map(int, input().split()) map(int, input().split()) n k = map(int, input().split()) map(int, input().split()) k ans = 0 0 ans p = list(map(int, input().split())) list(map(int, input().split())) p e = a / p[i] a / p[i] e
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

s = [0] * (n + 1)
for i in range(n):
    a = p[i] * (p[i] + 1) // 2
    e = a / p[i]
    s[i + 1] = s[i] + e

ans = 0
for i in range(n - k + 1):
    ans = max(ans, s[i + k] - s[i])
print('{:.12f}'.format(ans))
