int bsearch_1(int l,int r)
{
int mid = r+l>>1;
while(l<r)
{
if(check(mid)) r=mid;
else l=mid+1;
}
return l;
}
int bsearch_2(int l,int r)
{
int mid = r+l+1>>1;
while(l<r)
{
if(check(mid)) l = mid;
else r = mid-1;
}
return l;
}