Problem J: Finding Abundant Numbers #2

Problem J: Finding Abundant Numbers #2

Time Limit: 2 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 0
[Submit] [Status] [Web Board] [Creator:]

Description

In number theory, an abundant number is a natural number whose sum of all positive divisors, excluding itself, is greater than the number itself. For example, the sum of the proper divisors of 20 is 1+2+4+5+10=22 > 20, which is greater than the original number 20, so 20 is an abundant number. Write a program that takes two positive integers as input and outputs the number of abundant numbers between them.

Input

The number of test cases (t) is entered on the first line. (1 <= t <= 10)
Starting from the next line, t lines of two positive integers (m,n) are entered, one pair per line. (1 <= m <= n <= 100,000)

Output

For each test case, print the two input integers m and n connected by a hyphen (-), followed by a colon (:) and the number of abundant numbers on a separate line.
If no abundant numbers exist, print 'NO'. (Refer to sample output format.)

Sample Input Copy

3
1 20
20 50
37 38

Sample Output Copy

1-20:3
20-50:7
37-38:NO