#include
#include
using namespace std;
int main()
{
int arr[] = {10,20,30,40,40,40,50,60,100};
int n = sizeof(arr)/sizeof(int);
int k;
cin>>k;
//binary search is used when the array is sorted
bool it = binary_search(arr,arr+n,k);
cout<<it;
if(it){
cout<<"Present "<<end;
//lower_bound(s,e,k) gives the address of the >= key ie 40
//upper_bound(s,e,k) gives the address of the strictly > key ie 40
auto lb = lower_bound(arr,arr+n,k);
cout<<"the index of lower bound of "<<k<<" is "<<(lb-arr)<<endl;
auto up = upper_bound(arr,arr+n,k);
cout<<"the index of upper bound of "<<k<<" is "<<(up-arr)<<endl;
cout<<"the frequency or occerrence of "<<k<<" is "(up-lb)<<endl;
}
else
cout<<"absent";
return 0;
}