向上找最小值 和 向下找最大值
__int128 li = -2e18,ri = 2e18; //向上找最小值
while(li<ri) {
__int128 mid = (li+ri-1)/2;
if(a+mid*m>=l) ri=mid;
else li = mid+1;
}
__int128 lj = -2e18,rj = 2e18; //向下找最大值
while(lj<rj) {
__int128 mid = (lj+rj+1)/2;
if(a+mid*m<=r) lj=mid;
else rj = mid-1;
}