#include #include using namespace std; using namespace atcoder; using ll=long long; using S = long long; using F = long long; const S INF = 8e18; S op(S a, S b){ return std::min(a, b); } S e(){ return INF; } S mapping(F f, S x){ return (f+x)%2; } F composition(F f, F g){ return (f+g)%2; } F id(){ return 0; } int main(){ ll n,q; cin>>n>>q; vector a(n); for(ll i=0;i>a[i]; } lazy_segtree seg(a); while(q--){ ll l,r; cin>>l>>r; l--; seg.apply(l,r,1); } for(ll i=0;i