Pagini recente » Monitorul de evaluare | Cod sursa (job #1961858) | Cod sursa (job #1570533) | Cod sursa (job #2155278) | Cod sursa (job #2040600)
Program Flip1;
var c, l, i, j:byte;
a:array [1..16,1..16] of longint;
s, s1, s2:longint;
f, g:text;
begin
assign(f, 'flip.in'); assign(g, 'flip.out');
reset(f); rewrite(g);
read(f, c, l);
For i:=1 to c do For j:=1 to l do read(f, a[c][j]);
For i:=1 to c do begin
For j:=1 to l do s1:=s1+a[c][l];
For j:=1 to l do s2:=s2-a[c][l];
if s1<s2 then s:=s+s2
else s:=s+s1;
s1:=0; s2:=0;
end;
write(g, s);
close(f); close(g);
end.