P14955 [HackerEarth] Kuldeep and his girlfriend Cristie are both huge math nerds, so for their first anniversary he decides to take her out on a romantic getaway to Mathland, the city of mathematics and love
普及
题目描述

Kuldeep and his girlfriend Cristie are both huge math nerds, so for their first anniversary he decides to take her out on a romantic getaway to Mathland, the city of mathematics and love.

Now Kuldeep's arch-nemesis Rishabh, jealous of the perfect relationship between Kuldeep and Cristie, kidnaps Kuldeep's girl and imprisons her at the top floor of his dungeon.

Surprisingly the dungeon is in an apartment complex of n floors, numbered 1 to n, and being short on cash Rishabh can only lease some floors (continious) for his dungeon from floor a to floor b (inclusive).

Also to make sure so that Kulddep cannot come and rescue his girlfriend, Rishabh places guards on some of the floors he has leased.

Being a bit eccentric, he only places guards on those floors from a to b (inclusive), where the floor number has highest number of divisors.

Kuldeep apart from being a math genius is extremely proficient in the art of Wu Shu, a type of Chinese martial art, so it's easy for him to defeat the guards but he still takes 1 unit of health damage per guarded floor and Kuldeep dies if his health ever reaches 0 or less.

Your task is to help Kuldeep find the minimum amount of health units he needs to reach Cristie.

Input :

first line contain number of test cases T , next T line contains two numbers a and b.

Output :

Output minimum amount of health units he needs to reach Cristie.

Constraints:
1 ≤ T ≤ 100
1 ≤ n(number of floors) ≤ 10^8
0 ≤ b-a ≤ 10^4

SAMPLE INPUT
2
2 9
1 10SAMPLE OUTPUT
3
4Explanation

In first test case with a=2 and b=9, 6 and 8 are the floors with numbers which have highest number of divisors.So guards are placed at 2 floors only, therefore Kuldeep needs minimum 3 units of health to reach Cristie.

Similarly for second test case with a=1 and b=10, floor numbers with highest number of divisors are 6,8 and 10, so minimum health units required is 4.

输入格式

见题面

输出格式

见题面

样例输入
100 384 10384 887 10887 778 10778 916 10916 794 10794 336 10336 387 10387 493 10493 650 10650 422 10422 363 10363 28 10028 691 10691 60 10060 764 10764 927 10927 541 10541 427 10427 173 10173 737 10737 212 10212 369 10369 568 10568 430 10430 783 10783 531 10531 863 10863 124 10124 68 10068 136 10136 930 10930 803 10803 23 10023 59 10059 70 10070 168 10168 394 10394 457 10457 12 10012 43 10043 230 10230 374 10374 422 10422 920 10920 785 10785 538 10538 199 10199 325 10325 316 10316 371 10371 414 10414 527 10527 92 10092 981 10981 957 10957 874 10874 863 10863 171 10171 997 10997 282 10282 306 10306 926 10926 85 10085 328 10328 337 10337 506 10506 847 10847 730 10730 314 10314 858 10858 125 10125 896 10896 583 10583 546 10546 815 10815 368 10368 435 10435 365 10365 44 10044 751 10751 88 10088 809 10809 277 10277 179 10179 789 10789 585 10585 404 10404 652 10652 755 10755 400 10400 933 10933 61 10061 677 10677 369 10369 740 10740 13 10013 227 10227 587 10587 95 10095 540 10540
样例输出
2 2 3 2 3 2 2 2 2 2 3 2 3 2 3 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5 2 4 2 2 2 2 2 2 3 2 3 2 2 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2