program Project2; {$APPTYPE CONSOLE} uses SysUtils; var n,k,i,j,max: integer; a: array [0..10000,0..10000] of integer; begin { TODO -oUser -cConsole Main : Insert code here } assign(input,'legacy.in'); reset(input); readln(n,k); for i:=1 to n do for j:=1 to n do read(a[i,j]); assign(output,'legacy.out'); rewrite(output); max:=0; for i:=n downto 1 do for j:=n downto 1 do if (a[i,j]> max) and (a[j,i]> max) then max:=max+a[i,j]; write (max); end.