#Lutece0680. Betrand-Chebyshev
Betrand-Chebyshev
Migrated from Lutece 680 Betrand-Chebyshev
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
Zplinti1 has recently learn rand()
function in C/C++. He is so excited, since he finds using that function is easy and convenient. For example, if you want to generate a integer randomly from to , he can simply write rand()%10
.
However, rand()
function can’t generate a number which is too large. The maximum number is , by default. Zplinti1 is not satisfied with that!
Clever as he is, he quickly gets a way: he can multiply some rand()
functions together, to get a much larger number. If he write ( rand()%10000 ) * ( rand()%10000 )
, he can get a number as large as .
Unfortunately, one of his friends, bearchild, soon finds the problem: some numbers might not be got using his way described above. Zplinti1 wants to find the minimum number that cannot be got.
More precisely, we have numbers, from to . And for number , it is a value randomly chosen from to , then we set as the product of those numbers, what is the minimum positive number that cannot be the value of ? If there is no problem with the new function, output Good Function
.
Input
The first line of input contains a number , indicating the number of cases. ()
For each case, the first line is a number (). The second line contains numbers from to , all those numbers are positive numbers less than .
Output
For each case, output Case #i:
first. ( is the number of the test case, from to ). Then output the minimum value that cannot be, or Good Function
, as described above.
Samples
Note
As you can see, the maximum number zplinti1 can get is the product of to , when each rand()
function get its largest number. If the answer you get is larger than this maximum, you have to output Good Function
, and it is the only case you need to output that.
Resources
11th UESTC Programming Contest Preliminary