405855: GYM102135 H Large and even
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
H. Large and eventime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
Let f(x) be the greatest even divisor of x or 0, if there is no such divisor.
You are given n queries li, ri. For each of them you have to find .
InputThe first line contains one integer n (1 ≤ n ≤ 105) — the number of queries.
Each line of n subsequent lines contains two space-separated integers li and ri (1 ≤ li ≤ ri ≤ 105) — the description of i-th request.
OutputPrint n integers. On i-th line print one integer — the answer for the i-th query.
ExamplesInput1Output
2 12
42Input
2Output
1 42
42 45
462
86