class Solution {
public:
int searchBigSortedArray(ArrayReader * reader, int target) {
int l=0, r=0;
while(reader->get(r)<=target){
r=2*r+1;
}
while(l<r){
int mid = l+(r-l)/2;
if(reader->get(mid)<target) l=mid+1;
else r=mid;
}
return reader->get(r)==target?r:-1;
}
};