var i,j,total,max,r,path,n,m,x,y,z,s:integer;
a:array[0..11] of integer;//链表
b:array[1..100,1..2] of integer;//链表2
c:array[1..100,1..3] of integer;//原表
hash:array[1..100] of boolean;
procedure sort(l,r:integer);//快排的原因是qwq准备压缩
var i,j,x,y:integer;
begin
i:=l;
j:=r;
x:=c[(i+j) div 2,1];
repeat
while c[i,1]<x do inc(i);
while c[j,1]>x do dec(j);
if not(i>j) then
begin
y:=c[i,1]; c[i,1]:=c[j,1]; c[j,1]:=y;
y:=c[i,2]; c[i,2]:=c[j,2]; c[j,2]:=y;
y:=c[i,3]; c[i,3]:=c[j,3]; c[j,3]:=y;
inc(i); dec(j);
end;
until i&g
a:array[0..11] of integer;//链表
b:array[1..100,1..2] of integer;//链表2
c:array[1..100,1..3] of integer;//原表
hash:array[1..100] of boolean;
procedure sort(l,r:integer);//快排的原因是qwq准备压缩
var i,j,x,y:integer;
begin
i:=l;
j:=r;
x:=c[(i+j) div 2,1];
repeat
while c[i,1]<x do inc(i);
while c[j,1]>x do dec(j);
if not(i>j) then
begin
y:=c[i,1]; c[i,1]:=c[j,1]; c[j,1]:=y;
y:=c[i,2]; c[i,2]:=c[j,2]; c[j,2]:=y;
y:=c[i,3]; c[i,3]:=c[j,3]; c[j,3]:=y;
inc(i); dec(j);
end;
until i&g