program LCA(Tarjan); type arr=record u,v,w,next:longint; end; ; maxm=; ..maxm*] of arr; last,lasq,ans,fa:..maxn] of longint; flag:..maxn] of boolean; n,i,j,q,x,y:longint; procedure add(u,v:longint); begin inc(j); eg[j].u:=u; eg[j].v:=v; eg[j].next:=l…