#include<iostream>
using namespace std;

const int MAXN=3e5;

long long a[MAXN];

bool CanAverage(int n, int k, double x)
{
    double sum=0, sumpr=0;
    int cntpr=0;
    for(int i=0; i<k; i++)
    {
        sum+=a[i];
    }

    if(sum>=x*k)
    {
        return true;
    }

    for(int i=k; i<n; i++)
    {
        sum+=a[i]-a[i-k];
        if(a[i-k]*cntpr>sumpr)
        {
            sumpr=a[i-k];
            cntpr=1;
        }
        else
        {
            sumpr+=a[i-k];
            cntpr++;
        }

        if(sumpr<=x*cntpr)
        {
            sumpr=0;
            cntpr=0;
        }

        if(sum+sumpr>=x*(k+cntpr))
        {
            return true;
        }
    }

    return false;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n, k;
    cin >> n >> k;

    for(int i=0; i<n; i++)
    {
        cin >> a[i];
    }

    double l=1, r=1e6, diff=0.00001, ans;
    while(r-l>diff)
    {
        double mid=l+(r-l)/2;
        if(CanAverage(n, k, mid))
        {
            ans=mid;
            l=mid;
        }
        else
        {
            r=mid;
        }
    }

    cout << ans << "\n";

    return 0;
}
