|
||||||||||
GT and numbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2965 Accepted Submission(s): 737 Problem Description You are given two numbers $N$ and $M$. Every step you can get a new $N$ in the way that multiply $N$ by a factor of $N$. Work out how many steps can $N$ be equal to $M$ at least. If N can't be to M forever,print $-1$. Input In the first line there is a number $T$.$T$ is the test number. In the next $T$ lines there are two numbers $N$ and $M$. $T\leq1000$, $1\leq N \leq 1000000$,$1 \leq M \leq 2^{63}$. Be careful to the range of M. You'd better print the enter in the last line when you hack others. You'd better not print space in the last of each line when you hack others. Output For each test case,output an answer. Sample Input
Sample Output
Source | ||||||||||
|