Count Of Common Divisors

easy
Given two integer numbers, your task is to find count of all common divisors of given numbers

Input Format

The first line contains an integer T, number of test cases. The next t lines contain two numbers a and b each.

Output Format

Print number of common divisors in next t lines.

Constraints

1<= t <= 10^5
1<= a, b <= 10^5

Example

Input
3
100000 100000
12 24
747794 238336
Output
36
6
2

Previous
All Factors Using Sieve
Next
Gcd Length

Related Questions