minimum = A(0,0)
min_N = 0
min_M = 0
FOR i=0 TO N-1
FOR j=0 TO M-1
IF minimum > A(i,j) THEN
minimum = A(i,j)
min_N = i
min_M = j
END IF
NEXT j
NEXT i
FOR i = 0 TO N-1
A(i, min_M) = 0
NEXT i
FOR i = 0 TO M-1
A(min_N, i) = 0
NEXT i