def bsearch(n,l,r,res) if r0 do t=bsearch(n,1,10**10,1) n-=t ans<