#include "guess.h"

int find_number(int MAX) {
    int ans = 0;
    int lo = 0, hi = MAX;
    while (lo <= hi) {
        int mid = (lo + hi) / 2;
        bool x = smaller(mid);
        if (x) {
            hi = mid-1;
        }
        else {
            lo = mid+1;
            ans = mid;
        }
    }
    return ans;
}

