#include <iostream>
using namespace std;
int binsearch(int array[], int size, int key){
int left = 0;
int right = size;
int mid;
while (left <= right){
mid = left + (right - left) / 2;
if(key < array[mid])
right = mid - 1;
else if(key > array[mid])
left = mid + 1;
else return mid;
}
return -1;
}
int main() {
// your code goes here
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IGJpbnNlYXJjaChpbnQgYXJyYXlbXSwgaW50IHNpemUsIGludCBrZXkpewoJaW50IGxlZnQgPSAwOwoJaW50IHJpZ2h0ID0gc2l6ZTsKCWludCBtaWQ7CgoJd2hpbGUgKGxlZnQgPD0gcmlnaHQpewoJCW1pZCA9IGxlZnQgKyAocmlnaHQgLSBsZWZ0KSAvIDI7CgkJaWYoa2V5IDwgYXJyYXlbbWlkXSkKCQkJcmlnaHQgPSBtaWQgLSAxOwoJCWVsc2UgaWYoa2V5ID4gYXJyYXlbbWlkXSkKCQkJbGVmdCA9IG1pZCArIDE7CgkJZWxzZSByZXR1cm4gbWlkOwoJfQoJcmV0dXJuIC0xOwp9CgppbnQgbWFpbigpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCXJldHVybiAwOwp9