def gen(x,y):
for i in range(x,y+1):
if i==1:
continue
flag=0
for j in range (2,i):
if(i%j==0):
flag=1
break
if(flag==0):
print(i,end=" ")
n=int(input())
for i in range(n):
x=input().split(" β)
gen(int(x[0]),int(x[1]))
print(β")
def gen(x,y):
for i in range(x,y+1):
if i==1:
continue
flag=0
for j in range (2,i):
if(i%j==0):
flag=1
break
if(flag==0):
print(i,end=" ")
n=int(input())
for i in range(n):
x=input().split(" β)
gen(int(x[0]),int(x[1]))
print(β")
hey @ajaysiddartha ,
What is the actual problem that you are facing in this.
Kindly let me know.
Thank You .
im getting time limit exceeded
bro i solved itβ¦im resolving
Its good to hear that.
Thank You .
I hope Iβve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.