Peter wants to generate some prime numbers for his cryptosystem. Help  him! Your task is to generate all prime numbers between two given  numbers!InputThe input begins with the number t of test cases in a single line  (t<=10). In each of the next t lines there are two numbers m and n (1  <= m <= n <= 1000000000, n-m<=100000) separated by a space.OutputFor every test case print all prime numbers p such that m <= p <= n,  one number per line, test cases separated by an empty line.ExampleInput:21 103 5Output:235735My codex = raw_input()for i in range(int(x)):    a = map(int, raw_input().split())    if a[0] == 1:        a[0] = 2    for num in range(a[0],a[1]+1):        if num == 2:            print num        for j in range( 2, num):            if num%j == 0:                break            elif j == num - 1:                print num    print      i = i + 1
Codechef: Prime Number Generator
python;algorithm;python 2.7;time limit exceeded;primes