#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n>>k; string s; cin>>s; Int d=0; for(char c:s) d+=c-'0'; auto check= [&](Int x)->Int{ if(n<=d){ if(n<=x) return 1; Int y=x; for(Int i=0;i=k; y--; y+=s[i]-'0'; } return 1; } Int t=(x-d)/(n-d); Int cnt=n*t; Int res=(x+d*t)-cnt; while(cnt=k; }; Int l=0,r=k; while(l+1>1; if(check(m)) r=m; else l=m; } cout<