#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef vector vi; typedef vector vvi; #define rep(i,n) for(ll i=0;i<(n);i++) #define tii tuple #define tiii tuple #define mt make_tuple #define pb push_back #define ALL(a) (a).begin(),(a).end() #define FST first #define SEC second const int INF = (INT_MAX/2); const ll LLINF = (LLONG_MAX/2); const double eps = 1e-5; const double PI = M_PI; #define DEB cerr<<"!"<0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;} class segtree{ public: int Node; vector table; segtree(int); int ope(const int,const int); void update(int index,const int value){ // index is 0-indexed. index += Node; // query function table[index] = value; while(index > 0){ index /= 2; table[index] = ope(table[2*index],table[2*index+1]); } } int find(int l, int r); }; int segtree::find(int l,int r){ // l,r is 0-indexed. if(l == r) return table[r+Node]; l += Node; r += Node; int ans = 0; for(; l <= r;l >>=1, r >>=1){ if(r == l){ans=ope(ans,table[l]); return ans;} if(r%2 == 0) ans=ope(ans,table[r]),--r; if(l%2) ans=ope(ans,table[l]),++l; } return ans; } segtree::segtree(int Max_Node){ // initialize Node = 2; while(Node < Max_Node) Node *= 2; table.resize(2*Node); for(int i = Node;i < Node*2; i++) table[i] = 0; // initialize for(int i= Node-1; i > 0; i--) table[i] = ope(table[i*2],table[i*2+1]); } int segtree::ope(const int a,const int b){ return a+b; } int main(){ int n,k; cin >> n >> k; segtree st(1000000); string s; cin >> s; rep(i,s.size()) if(s[i] == '1') st.update(i,1); rep(i,s.size()) if(s[i] == '1') st.update(i+s.size(),1); double ans = 0; rep(i,s.size()*2){ for(int j = k-1; i+j < s.size()*2+1; j++){ ans = max(ans,double(st.find(i,i+j))/double(j+1)); if(st.find(i,i+j+1) == 0) break; if(ans == 1.)break; } } cout << fixed << setprecision(10) << ans << endl; }