import sys input = sys.stdin.readline N,Q=map(int,input().split()) for tests in range(Q): s,t=map(int,input().split()) ANS=0 while s