Где только находят такие задачи О_о ну вот uses crt; type auto=record nom: string; sht: integer; end; var f,g: text; a: array[1… 100] of auto; s,s1: string; n,k,i,j,c,p,r: integer; x: auto; beginclrscr; assign (f,'input.txt'); reset (f); assign (g,'output.txt'); rewrite (g); read (f,n); readln (f,s); readln (f,s); k: =1; a[k].nom: =copy (s,1,8); delete (s,1,9); val (s,a[k].sht,c); for i: =2 to n do begin readln (f,s); s1: =copy (s,1,8); delete (s,1,9); val (s,r,c); p: =0; j: =1; while (j <= k) and (p=0) do if s1=a[j].nom then begin p: =j; a[p].sht: =a[p].sht+r end else j: =j+1; if p=0 then begin k: =k+1; a[k].nom: =s1; a[k].sht: =r; end; end; close (f); for i: =1 to k-1 dofor j: =i+1 to k doif a[i].sht