MINE.INP
MINE.OUT
3 3
1 4 2
4 5 3
2 3 3
YES
1 0 1
0 1 1
1 1 0
{**************************************************************************
* Ten FILE de bai: MINE.RTF *
* Ngay viet : 07/09/2003 *
* Nguoi viet : LE THANH BINH *
* Thuat toan : DUYET QUAY LUI *
**************************************************************************}
{$A+,B-,D+,E+,F-,G-,I+,L+,N+,O-,P-,Q-,R-,S+,T-,V+,X+}
{$M 65000,0,655360}
USES crt;
CONST
tfi = 'MINE.INP';
tfo = 'MINE.OUT';
maxMN = 100;
VAR
fi,fo : TEXT;
M,N : INTEGER;
a : ARRAY[1..maxMN,1..maxMN] OF INTEGER;
Good : BOOLEAN;
x : ARRAY[0..maxMN+1,0..maxMN+1] OF INTEGER;
PROCEDURE DOcdl;
VAR i,j: INTEGER;
BEGIN
readln(fi,M,N);
FOR i:=1 TO M DO
BEGIN
FOR j:=1 TO N DO read(fi,a[i,j]);
readln(fi);
END;
END;
PROCEDURE Duyet1;
VAR CN: BOOLEAN;
j: INTEGER;
BEGIN
good:=TRUE;
x[1,0]:=0;
FOR x[1,1]:=0 TO 1 DO
BEGIN
CN:=TRUE;
FOR j:=2 TO N DO
BEGIN
x[1,j]:=a[1,j-1]-x[1,j-2];