|Technocup 2019 - Elimination Round 2|
You are given two positive integers $$$a$$$ and $$$b$$$. There are two possible operations:
What is the minimum number of operations required to obtain two integers having the same number of divisors? You are given several such pairs, you need to find the answer for each of them.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of pairs of integers for which you are to find the answer.
Each of the next $$$t$$$ lines contain two integers $$$a_i$$$ and $$$b_i$$$ ($$$1 \le a_i, b_i \le 10^6$$$).
Output $$$t$$$ lines — the $$$i$$$-th of them should contain the answer for the pair $$$a_i$$$, $$$b_i$$$.
These are the numbers with equal number of divisors, which are optimal to obtain in the sample test case:
Note that there can be several optimal pairs of numbers.