Skip to content

Instantly share code, notes, and snippets.

@Eric-Bro
Created January 30, 2012 15:44
Show Gist options
  • Save Eric-Bro/1705042 to your computer and use it in GitHub Desktop.
Save Eric-Bro/1705042 to your computer and use it in GitHub Desktop.
var i, k, q, w, h, line, tmp: integer;
sum_1, sum_2 : array [1..50] of integer;
begin
assign(INPUT, 'Input.txt');
reset(INPUT);
assign(OUTPUT, 'Output.txt');
rewrite(OUTPUT);
readln(w,h);
k:=1;
line:=1;
writeln(w div 2,' ', h div 2);
while (line <= h) do
begin
q:=1;
while (q <= w div 2) do
begin
for i:= 1 to 2 do
begin
read(tmp);
sum_1[q]:= sum_1[q] + tmp;
end;
if (line mod 2 = 0) then
begin
if (sum_1[q] >= 2) then write(1, ' ') else write(0, ' ');
for i:=1 to q do sum_1[i]:= 0;
end;
inc(q);
end;
inc(line);
writeln;
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment