11606 - Factor Counter   

Description

Given an interval [L,R], please find out the integer which has the most positive factors (正因數) in this interval.

If there are multiple answers, print the smallest of them.

Input

The first line contains an integer T, representing the number of testcases.

The next T lines contain two integers L and R, representing the endpoints of the interval.

  • 1 ≤ T ≤ 20
  • 1 ≤ L ≤ R ≤ 20000

Output

For each testcase, please output a line contains an integer representing your answer.

(i.e. Please print '\n' after each answer.)

Sample Input  Download

Sample Output  Download

Tags

:) :( >< :D :G konpeko



Discuss