#include using namespace std; const int T=100009; const int maxn=200009; const int SIZE=500; const int B=34000; int n,m,Tn; int a[maxn]; int b[maxn]; bitsetf[B+9],now; int c[T]; int nn; struct Section{ int l,r,id; bool operator < (const Section &rhs) const{ if(l/SIZE==rhs.l/SIZE)return rp[i].l)insert(a[--L]); while(R>p[i].r)delt(a[R--]); while(L