{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q-,R-,S+,T-,V+,X+} {$M 16384,0,655360} program TALLAGE; type Coord=record X, Y: real; end; type Rebr=record B, E, N: integer; Z: real; f: boolean; end; const D=3; var N, i, j, t, k: integer; V: array[1..D] of Coord; L: array[1..3*D] of Rebr; procedure PLength (s1, s2: integer; var Res: real); begin Res:=Sqrt (Sqr (Abs (V[s1].X - V[s2].X)) + Sqr (Abs (V[s1].Y - V[s2].Y))); end; procedure Kraskala; var i, j: integer; pr: real; begin for i:=1 to N-1 do for j:=i+1 to N do if L[i].Z>L[j].Z then begin pr:=L[i].Z; L[i].Z:=L[j].Z; L[j].Z:=pr; end; end; begin Assign (Input, 'TALLAGE.DAT'); Reset (Input); Read (N); i:=1; while i<=N do begin Read (V[i].X, V[i].Y); inc (i); end; k:=-2; for i:=1 to N do begin inc(k); for j:=1 to N do if i<>j then begin t:=k+j; if L[t].f then Continue; PLength (i, j, L[t].Z); L[t].B:=i; L[t].E:=j; L[t].N:=t; L[t].f:=true; end; end; Close (Input); Kraskala; Assign (Output, 'TALLAGE.RES'); Rewrite (Output); for i:=1 to 50 do begin writeln(L[i].b,' ',L[i].e,' ',L[i].z); end; Close (Output); end.