#P10974. [2015杭电多校]Root
[2015杭电多校]Root
Root
Problem Description
Given a number ,we have queries which contains a pair () and would like to know the smallest nonnegative integer satisfying when the prime number (ps:)
Input
The first line contains a number T, indicating the number of test cases. For each case, each case contains two integers in the first line. The next lines will contains two intgeers
Output
For each test case,output "Case #:" and lines.( is the case number) Each line cotain a integer which is the smallest integer for () ,if we can't find such a integer just output "-1" without quote.
Sample Input
1
175 2
2 1
2 3
Sample Output
Case #1:
0
3
Hint
So the answer to (2,1) is 0
Author
UESTC
Source
2015 Multi-University Training Contest 7