#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define F first
#define S second
#define fast std::ios_base::sync_with_stdio(false)
#define mod 1000000007
#define pi 3.14159265
int main() {
fast;
lli n,k;
cin>>n>>k;
lli a[n],i;
fr(i,n)
{
cin>>a[i];
}
double b[n],sum=0,ans=0;
fr(i,n)
{
b[i]=(float)(a[i]+1)/2;
}
fr(i,k)
{
sum+=b[i];
}
ans=sum;
for(i=k;i<n;i++)
{
sum-=b[i-k];
sum+=b[i];
ans=max(ans,sum);
}
cout<<fixed<<setprecision(8)<<ans;
return 0;
}
ICNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojZGVmaW5lIGxsaSBsb25nIGxvbmcgaW50CiNkZWZpbmUgbXAoYSxiKSBtYWtlX3BhaXIoYSxiKQojZGVmaW5lIHBiKGEpIHB1c2hfYmFjayhhKQojZGVmaW5lIGZyKGksbikgZm9yKGk9MDtpPG47aSsrKQojZGVmaW5lIEYgZmlyc3QKI2RlZmluZSBTIHNlY29uZAojZGVmaW5lIGZhc3Qgc3RkOjppb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKQojZGVmaW5lIG1vZCAxMDAwMDAwMDA3CiNkZWZpbmUgcGkgMy4xNDE1OTI2NQppbnQgbWFpbigpIHsKCWZhc3Q7CglsbGkgbixrOwoJY2luPj5uPj5rOwoJbGxpIGFbbl0saTsKCWZyKGksbikKCXsKCQljaW4+PmFbaV07Cgl9Cglkb3VibGUgYltuXSxzdW09MCxhbnM9MDsKCWZyKGksbikKCXsKCQliW2ldPShmbG9hdCkoYVtpXSsxKS8yOwoJfQoJZnIoaSxrKQoJewoJCXN1bSs9YltpXTsKCX0KCWFucz1zdW07Cglmb3IoaT1rO2k8bjtpKyspCgl7CgkJc3VtLT1iW2kta107CgkJc3VtKz1iW2ldOwoJCWFucz1tYXgoYW5zLHN1bSk7Cgl9Cgljb3V0PDxmaXhlZDw8c2V0cHJlY2lzaW9uKDgpPDxhbnM7CgkKCXJldHVybiAwOwp9