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(input())
def MI(): return map(int,input().split())
def MF(): return 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 sys def RD(): return sys.stdin.read() RD def II(): return int(input()) II def MI(): return map(int,input().split()) MI def MF(): return map(float,input().split()) MF def LI(): return list(map(int,input().split())) LI def LF(): return list(map(float,input().split())) LF def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

#import numpy as np TI 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) main n,k=MI() n MI() MI k p=LI() p LI() LI for i in range(n):
		p[i]=p[i]/2+0.5
	#print(p)

	 i range(n) range n p[i]=p[i]/2+0.5 p[i] p i p[i]/2+0.5 p[i]/2 p[i] p i 2 0.5 ans=sum(p[:k]) ans sum(p[:k]) sum p[:k] p :k k now=sum(p[:k]) now sum(p[:k]) sum p[:k] p :k k for i in range(n-k):
		now=now-p[i]+p[i+k]
		ans=max(ans,now)
	 i range(n-k) range n-k n k now=now-p[i]+p[i+k] now now-p[i]+p[i+k] now-p[i] now p[i] p i p[i+k] p i+k i k ans=max(ans,now) ans max(ans,now) max ans now print(ans) print ans if __name__ == "__main__":
	main() __name__ == "__main__" __name__ "__main__" main() main def LF(): return list(map(float,input().split())) def LF(): return list(map(float,input().split())) LF 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) 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) main def MI(): return map(int,input().split()) def MI(): return map(int,input().split()) MI def MF(): return map(float,input().split()) def MF(): return map(float,input().split()) MF def RD(): return sys.stdin.read() def RD(): return sys.stdin.read() RD def II(): return int(input()) def II(): return int(input()) II def LI(): return list(map(int,input().split())) def LI(): return list(map(int,input().split())) LI def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

#import numpy as np def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

#import numpy as np TI
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(input())
def MI(): return map(int,input().split())
def MF(): return 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()
