#include <iostream>
using namespace std;
const int N = 15;
int n, m, cnt, a[N][N];
void check(int x, int y)
{
int t = a[x][y];
int mx = 0, mn = 0x3f3f3f3f;
for (int i = 1; i <= n ; i ++ ) mn = min(mn, a[i][y]);
for (int i = 1; i <= m ; i ++ ) mx = max(mx, a[x][i]);
...