#include<stdio.h> const int M = 1000; const int N = 1000; int a[M][N]; int main() { int m, n; while(scanf("%d%d", &m, &n) != EOF) { for(int i = 0; i < m; i++) for(int j = 0; j < n; j++) scanf("%d", &a[i][j]); ...