Scanning integer matrices by means of two rectangular windows