#include #include #include int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int n, k; std::cin >> n >> k; std::vector s(n); std::queue iceQueue; for(int i=0; i> s[i]; } auto FillQueue = [&]{ static auto it = s.begin(); while(static_cast(iceQueue.size()) <= n){ iceQueue.push((*it)-'0'); ++it; if(it==s.end()) it=s.begin(); } }; int buyNum = 0; int freeNum = 0; for(int i=0; i