#include using namespace std; typedef long long int64; int main() { int64 N, K; string A; cin >> N >> K; cin >> A; auto check = [&](double k) { int sum = 0; queue< double > lazy, lazy2; multiset< double > bit; bit.emplace(1e9); lazy.emplace(0.0); lazy2.emplace(0.0); for(int i = 0; i < N + N; i++) { if(K <= i + 1) { bit.emplace(lazy.front()); lazy.pop(); } if(K <= i + 1 - N) { bit.erase(bit.find(lazy2.front())); lazy2.pop(); } sum += A[i % N] - '0'; if(*bit.begin() <= sum - (i + 1) * k) return (true); lazy.emplace(sum - (i + 1) * k); lazy2.emplace(sum - (i + 1) * k); } return (false); }; double low = 0.0, high = 1.0; for(int i = 0; i < 44; i++) { double mid = (low + high) * 0.5; if(check(mid)) low = mid; else high = mid; } cout << fixed << setprecision(10) << low << endl; }