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

typedef long long LL;

LL p[511][511];
int nn, mm;

LL getval(int i, int j) {
    if(i >= 1 && i <= nn && j >= 1 && j <= mm) {
        if(p[i][j] > 0) return p[i][j];
        return p[i][j] = value(i, j);
    }
    return p[i][j] = LLONG_MAX;
}

pair<int, int> find_locmin_point(int N, int M) {
    int i = 1;
    nn = N, mm = M;
    while(i <= M) {
        if(getval(1, i - 1) > getval(1, i) && getval(1, i) < getval(1, i + 1)) {
            return {1, i};
        }
        i++;
    }
}









