#include<bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e18 + 10;
const int MAXN = 510;
long long arr[MAXN];
bool vis[MAXN];
long long value(int r, int c);
pair<int, int> find_locmin_point(int N, int M){
	long long prev = INF;
	for(int i = 1; i <= M; i++){
		long long curr, sled;
		if(vis[i]){
			curr = arr[i];
		}else{
			curr = value(1, i);
		}
		if(vis[i + 1]){
			sled = arr[i + 1];
		}else{
			sled = value(1, i + 1);
		}
		if(prev > curr && sled > curr){
			return make_pair(1, i);
		}
		prev = curr;
	}
	return make_pair(0, 0);
}
