Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- A: array[1..100, 1..100] of integer;
- n, m, i, j, k, l, res, x1, y1, x2, y2: integer;
- good: boolean;
- begin
- read(n, m);
- for i := 1 to n do begin
- for j := 1 to m do
- read(A[i, j]);
- end;
- res := -1;
- for i := 1 to n do begin
- for j := 1 to n do begin
- good := true;
- for k := i to n do begin
- for l := j to n do begin
- if (A[i, j] <> 1) then begin
- good := false;
- end;
- end;
- end;
- if good and ((k - i + 1) * (l - j + 1) > res) then begin
- res := (k - i + 1) * (l - j + 1);
- x1 := i;
- y1 := j;
- x2 := k;
- y2 := l;
- end;
- end;
- end;
- if (res = -1) then begin
- writeln('it''s boring :(');
- end
- else begin
- writeln(res);
- writeln(x1, ' ', y1, ' ', x2, ' ', y2);
- end;
- readln;
- end.
Add Comment
Please, Sign In to add comment