n,q = map(int,input().split()) for _ in range(q): s,t = map(int,input().split()) s,t = s+(1<>= 1 t >>= 1 print(ans)