P13477 [CodeChef] aba14a
NOI
题目描述

Ramkumar loves to solve riddles one day SpojSathyagave him a riddle to solve.
Sathya will give him pair of integers a and b. Ramkumar has to find the largest
number in the range [a,b] inclusive which can be represented as product of atleast two prime numbers. But ramkumar is busy in watching "Arrow" he is asking your help. Help him to find the largest such number in that range.

Input format:

The first line will have a integer T. 
Next T lines will have a pair of numbers a and b.

Output format:
For each testcase print in a single line the largest number in the range that
satisfies the above condition else if you can't find such number print "-1".

Constraints:
1<=T<=100 (for each testcase file)
2<=a<=b<=10^12
Sample Input:
2
5 11
7 35
Sample Output:
10
35

输入格式

见题面

输出格式

见题面

样例输入
2 5 11 7 35
样例输出
10 35