#include #include #define ft first #define sc second #define pt(sth) cout << sth << "\n" #define chmax(a, b) (a)=max(a, b) #define chmin(a, b) (a)=min(a, b) #define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD using namespace std; typedef long long ll; typedef pair pll; static const ll INF=1e18; static const ll MAX=101010; static const ll MOD=1e9+7; /* for(i=0; i> a[i]; */ ll N, M; string s; ll collision_left(ll k) { if(k==0) return 1; ll i; for(i=0; i=N) k=N-1; } return 0; } ll collision_right(ll k) { if(k==N-1) return 1; ll i; for(i=0; i> N >> M; ll a[MAX*2]; for(i=0; i> a[i]; cin >> s; ll l=0, r=N; while(l+1=R) { ll sum=0; for(i=0; i=N) k=N-1; } for(i=0; i=N) k=N-1; } ll lk=k; k=N-1; for(i=0; i=N) k=N-1; } ll rk=k; vector v; for(i=0; i