Home > Back-end >  Within the scope of the {is} a to b (including a and b) all the prime Numbers of prime Numbers, comp
Within the scope of the {is} a to b (including a and b) all the prime Numbers of prime Numbers, comp

Time:11-01

To solve the
Within the scope of a to b (including a and b) all the prime Numbers of prime Numbers, composition method is: the smallest prime and the biggest prime form a pair, the second prime and second largest prime form a pair, the third a pair of small prime and the third largest prime composition,... , and so on, so that may have a prime can't add up to prime for it alone in pairs,

Output in turn each prime Numbers for the sum of two prime Numbers,



Enter
More groups of cases, a positive integer n, says the number of cases, (n<=20)

Cases in each group is composed of two positive integers a and b, (a<=b<=10000, ensure that at least one prime Numbers between a to b)


O
Cases for each group, which in turn output each prime Numbers for the sum of two prime Numbers, each should have a space between the two output digital characters, behind the last digit can not have Spaces,

Cases in each group output will wrap,

The sample input
2

1 10

2 18


Sample output

9 8

16 16 July 19

HINT
Prime Numbers between 1 ~ 10 to 2 hc-positie, including 2 and 7 was the first prime to, and 9; 3 and 5 is the second prime Numbers, and of 8, pay attention to a space after 9, 8 no Spaces behind,

Prime Numbers is 2,3,5,7,11,13,17 between 2 ~ 18, among them 2 and 17 was the first prime Numbers for and 19; 3 and 13 is the second prime Numbers, and to 16; 5 and 11 is the third prime Numbers, and to 16; 7 alone, in pairs and is 7,

  • Related