def binary_search(): l, r = 0, N while l<=r: m = (l+r)//2 if m*(m+1)