#include "locmin.h"
#include "bits/stdc++.h"
using namespace std;

#define ll long long

pair<int,int>find_locmin_point(int N,int M)
{
      vector<vector<ll>>a(N+2,vector<ll>(M+2,-1));
      for(int i=1;i<=N;i++){
            for(int j=1;j<=M;j++){
                  a[i][j]=value(i,j);
            }
      }
      for(int i=1;i<=N;i++){
            for(int j=1;j<=M;j++){
                  if(a[i][j]<a[i-1][j]&&a[i][j]<a[i+1][j]&&a[i][j]<a[i][j+1]&&a[i][j]<a[i][j-1]) return {i,j};
            }
      }
}
