#include using namespace std; #define forn(i,n) for(int i=0; i<(int)(n); i++) #define pb push_back const int maxn=100005; const int maxlogn=20; vector level(maxn, -1); vector< vector > parent(maxn, vector(maxlogn, -1)); vector< vector > grafo; void rootTree(int toy, int vengo, int nivel){ level[toy]=nivel; parent[toy][0]=vengo; forn(i, grafo[toy].size()){ if(grafo[toy][i]==vengo)continue; rootTree(grafo[toy][i], toy, nivel+1); } } int LCA(int u, int v){ if(level[u]=0; i--){ if(parent[u][i]!=-1 && parent[u][i]!=parent[v][i]){ //cout<<"subo de "<>N; forn(i, N){ vector v; if(2*i+10)v.pb((i-1)/2); grafo.pb(v); } rootTree(0, -1, 0); for(int j=1; (1<>q; while(q--){ int u, v; cin>>u>>v; cout<