#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 bool check(vector a){ if(a.size()==1)return abs(a[0]-0.5)<1e-10; rep(i,a.size()-1){ auto b = a; b.erase(b.begin()+i,b.begin()+i+2); b.insert(b.begin()+i,(a[i] + a[i+1])/2.0); if(check(b))return true; } return false; } bool sol(vector a){ int c = 0; int n =a.size(); //if(n>=10)return true; rep(i,n-1){ if(a[i]!=a[i+1])c++; } if(c%2==1 || c>=8){ return true; } int t = a[0]^1; c = 0; rep(i,n-1){ if(a[i]==t && a[i+1]==t){ c = 1; } } if(c){ return true; } else{ return false; } } int main(){ int _t; cin>>_t; /* rep(i,1<<_t){ vector a(_t); vector b(_t); rep(j,_t){ if((i>>j)&1){ a[j] = 1; b[j] = 1; } else{ a[j] = 0; b[j] = 0; } } if(sol(a)!=check(b)){ cout<<(bitset<10>(i))<<":"<>n; vector a(n); rep(i,n){ scanf("%d",&a[i]); } //cout< b(n); rep(i,n)b[i] = a[i]; cout<