#Lutece1188. Log
Log
Migrated from Lutece 1188 Log
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
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
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.
Samples
1
175 2
2 1
2 3
Case #1:
0
3
Note
So the answer to (2,1) is 0
Resources
Prepare for 2015 MU2015 Multi-University Training