#include <iostream>
using namespace std;
const int f[] = {-1,0,0,0,0,1,1,1,2,2,2,2,2,3,3,3};
int main() {
int l = 0, r = 15;
while( l+1 < r ) {
int x = l + (r-l)/2;
if( f[x] < 2 )
l = x;
else
r = x;
}
cout << "(l;r] = " << "(" << l << ";" << r << ")" << "\n";
cout << "f(r) = " << f[r] << "\n";
if( f[r] == 2 )
cout << "FOUND";
else
cout << "NOT FOUND";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IGZbXSA9IHstMSwwLDAsMCwwLDEsMSwxLDIsMiwyLDIsMiwzLDMsM307CgppbnQgbWFpbigpIHsKCQoJaW50IGwgPSAwLCByID0gMTU7IAoJd2hpbGUoIGwrMSA8IHIgKSB7CiAgCQlpbnQgeCA9IGwgKyAoci1sKS8yOwogIAkJaWYoIGZbeF0gPCAyICkKICAgIAkJbCA9IHg7CiAgCQllbHNlCiAgICAJCXIgPSB4OyAKCX0KCQoJY291dCA8PCAiKGw7cl0gPSAiIDw8ICIoIiA8PCBsIDw8ICI7IiA8PCByIDw8ICIpIiA8PCAiXG4iOwoJY291dCA8PCAiZihyKSA9ICIgPDwgZltyXSA8PCAiXG4iOwoJaWYoIGZbcl0gPT0gMiApIAoJCWNvdXQgPDwgIkZPVU5EIjsgCgllbHNlIAoJCWNvdXQgPDwgIk5PVCBGT1VORCI7CgkKCXJldHVybiAwOwp9