import sys



read = sys.stdin.buffer.read

input = sys.stdin.buffer.readline

inputs = sys.stdin.buffer.readlines



# mod=10**9+7

# rstrip().decode('utf-8')

# map(int,input().split())

# import numpy as np



def main():

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

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

	

	s=sum(p[:k])

	ans=s

	

	for i in range(n):

		try:

			s=s-p[i]+p[i+k]

			ans=max(ans,s)

		except:

			break

	

	print(((ans+k)/2))

	

	

	

if __name__ == "__main__":

	main()

import sys

#input = sys.stdin.buffer.readline





#sys.setrecursionlimit(10**9)

#from functools import lru_cache



def RD(): return sys.stdin.read()

def II(): return int(eval(input()))

def MI(): return list(map(int,input().split()))

def MF(): return list(map(float,input().split()))

def LI(): return list(map(int,input().split()))

def LF(): return list(map(float,input().split()))

def TI(): return tuple(map(int,input().split()))

# rstrip().decode()



#import numpy as np



def main():

	n,k=MI()

	p=LI()



	for i in range(n):

		p[i]=p[i]/2+0.5

	#print(p)



	ans=sum(p[:k])

	now=sum(p[:k])



	for i in range(n-k):

		now=now-p[i]+p[i+k]

		ans=max(ans,now)

	print(ans)































if __name__ == "__main__":

	main()

import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines
# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np
def main():
    n, k = list(map(int, input().split()))
    p = list(map(int, input().split()))
    s = sum(p[:k])
    ans = s
    for i in range(n):
        try:
            s = s - p[i] + p[i + k]
            ans = max(ans, s)
        except:
            break
    print(((ans + k) / 2))


if __name__ == "__main__":
    main()

import sys

# input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**9)
# from functools import lru_cache
def RD():
    return sys.stdin.read()


def II():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def MF():
    return list(map(float, input().split()))


def LI():
    return list(map(int, input().split()))


def LF():
    return list(map(float, input().split()))


def TI():
    return tuple(map(int, input().split()))


# rstrip().decode()
# import numpy as np
def main():
    n, k = MI()
    p = LI()
    for i in range(n):
        p[i] = p[i] / 2 + 0.5
    # print(p)
    ans = sum(p[:k])
    now = sum(p[:k])
    for i in range(n - k):
        now = now - p[i] + p[i + k]
        ans = max(ans, now)
    print(ans)


if __name__ == "__main__":
    main()

-read = sys.stdin.buffer.read -input = sys.stdin.buffer.readline -inputs = sys.stdin.buffer.readlines -# mod=10**9+7 -# rstrip().decode('utf-8') -# map(int,input().split()) +# input = sys.stdin.buffer.readline +# sys.setrecursionlimit(10**9) +# from functools import lru_cache +def RD(): +    return sys.stdin.read() + + +def II(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def MF(): +    return list(map(float, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def LF(): +    return list(map(float, input().split())) + + +def TI(): +    return tuple(map(int, input().split())) + + +# rstrip().decode() -    n, k = list(map(int, input().split())) -    p = list(map(int, input().split())) -    s = sum(p[:k]) -    ans = s +    n, k = MI() +    p = LI() -        try: -            s = s - p[i] + p[i + k] -            ans = max(ans, s) -        except: -            break -    print(((ans + k) / 2)) +        p[i] = p[i] / 2 + 0.5 +    # print(p) +    ans = sum(p[:k]) +    now = sum(p[:k]) +    for i in range(n - k): +        now = now - p[i] + p[i + k] +        ans = max(ans, now) +    print(ans)