#include "locmin.h"
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
vector<ll> vec(501,-1);
const double phi=1.618;
ll ask(ll i){
    if(vec[i]==-1)vec[i]=value(1,i);
    return vec[i];
}
ll get(ll a, ll b){
    ll c=(1/(2+phi))*(b-a)+a;
    ll d=((1+phi)/(2+phi))*(b-a)+a;
    ask(a);ask(b);ask(c);ask(d);
    if(vec[c]>vec[a])return get(a,c);
    if(d>b)return get(d,b);
    if(c<d)return get(a,d);
    return get(c,b);
}
std::pair <int, int> find_locmin_point(int N, int M) {
    get(1,M);
}
