#include using namespace std; using ll = long long; int main(){ int n; cin>>n; vector a(n); for(int i = 0;i>a[i]; vector dp(1<>j&1) { if(i>>j&1) continue; for(int k = j + 1;k>k&1) { if(i>>k&1) continue; assert(j!=k); int nxt = i | 1<