#include #define pt(sth) cout << sth << "\n" #define itr(x,c) for(auto x=c.begin();x!=c.end();x++) #define ritr(x,c) for(auto x=c.rbegin();x!=c.rend();x++) #define all(a) (a.begin()),(a.end()) #define rall(a) (a.rbegin()),(a.rend()) #define __builtin_popcount(v) popcount(v) using namespace std; #include using namespace atcoder; typedef long long ll; typedef pair pll; templatebool chmax(T &a, const T &b) {if(abool chmin(T &a, const T &b) {if(b>a[i]; typedef vector v1d; typedef vector v2d; typedef vector v3d; typedef vector v4d; int main(void) { ll i,j,k,l; ll N,C;cin>>N>>C; v1d p(N),a,b; for(i=0;i>p[i]; for(i=0;i>t>>x; if(t==1) a.push_back(x); else b.push_back(x); } while(ll(a.size())