#include "guess.h"
int find_number(int MAX) {
    int l=1, r=1;
    while (true){
        bool b=smaller(r);
        if (b){
            break;
        } else {
            l=r+1;
            r*=2;
        }
    }
    while (l<=r){
        int m=(l+r)/2;
        bool b=smaller(m);
        if (b){
            r=m-1;
        } else {
            l=m+1;
        }
    }
    return r;
}

