#include #define REP(i,n,N) for(int i=(n);i<(int) N;i++) #define p(s) cout<<(s)<>D>>s>>s1; s=x+s+s1+x; int ans=0; REP (i,0,s.size()-D+1) { int cnt = 0; int mx = 0; s1 = s; REP (j,0,D) { if (s1[j+i] == 'o') break; s1[j+i] = 'o'; } REP (j,0,s1.size()) { if (s1[j] == 'o') { cnt++; } else { mx = max(cnt, mx); cnt = 0; } } mx = max(cnt, mx); ans = max(ans, mx); } p(ans); return 0; }