#include using namespace std; #define mp make_pair #define mt make_tuple #define rep(i,begin,end) for (__typeof(begin) i=(begin),_end=(end),_step=1-2*((begin)>(end));i!=_end;i+=_step) // OUTPUT template ostream& operator << (ostream& os, const pair& p) { os<<"("< ostream& operator << (ostream& os, const vector& v) { os<<"["; if (!v.size()) os<<"]"; else for (int i=0;i ostream& operator << (ostream& os, const set& s) { os<<"{"; if (!s.size()) os<<"}"; else for (auto x:s) os< void printr(ostream& os, const T& t, const Args&... args){ os< void read(T& x) {cin>>x;} template void read(T& t, Args&... args){ read(t),read(args...); } template void readarray(T* A,int n) { rep(i,0,n) read(A[i]); } // DEBUG void dbgr(ostream& os) { os< void dbgr(ostream& os, const T& t, const Args&... args) { os<