Even after aplying prime seive one test case is still showing TLE.
t=int(input())
while t>0:
l=[int(x) for x in input().split()]
a=l[0]
n=l[1]
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * p, n+1, p):
prime[i] = False
p += 1
for p in range(a, n+1):
if prime[p]:
if p >1:
print (p,end=" ")
print()
t-=1