#include #include using namespace std; #define DBG #ifdef DBG #define PDBG(X) cout< *Tournament; long int n, TreeDepth; inline double min (double a, double b) { return a= (unsigned long int)num) break; prod <<= 1; } return i; } long int nextPow2 (long int num) { long int ans = 1; while (ans>n; vector tournament[log2(n)+1]; Tournament = &tournament[0]; for ( i=0; i>tmp; tournament[0].push_back(tmp); } for (i=0, tsz=n; tsz>2; tsz=(tsz+1)/2, i++) { for (int j=1; j1; tsz= (tsz==1?0:(tsz+1)/2) , i++) { for (int j=0; j>m; while(m--) { long int l, r; cin>>l>>r; cout<