vari,j,k,l,m,n,head,tail:longint;q,ans:array[0..100000]of longint;v:array[0..100000]of boolean;procedure push(j:longint);beginif not v[j] thenbegininc(tail);q[tail]:=j;v[j]:=true;ans[j]:=ans+1;end;end;function bfs(m,n:longint):longint;beginhead:=1;tail:=1;q[head]:=m;v[m]:=true;while hea... |