i am getting timelimit for the 2nd testcase…
here is my code…
import math
t=int(input())
for k in range(t):
m,n=input().split()
m=int(m)
n=int(n)
for i in range(m,n+1):
c=0
for j in range(2,int(math.sqrt(i))+1):
if i%j==0:
c+=1
break
if c==0 and i!=1:
print(i,end=’ ')
print()