PRIMEZUK  The Prime conjecture
Euclid may have been the first to prove that there are infinitely many primes. Let's walk through his proof, as even today, it's regarded as an excellent model of reasoning.
Let us assume the converse, that there only a finite number of primes: p_{1}, p_{2}, ..., p_{n}. Let m = 1 + _{i=1}Π^{n }p_{i,} i.e. the product of all of these primes plus one. Since this number is bigger than any of the primes on our list, m must be composite. Therefore, some prime must divide it. But which prime? In fact, m leaves a reminder of 1 when divided by any prime p_{i}, for 1 <= i <= n. Thus, p_{1}, p_{2}, ..., p_{n} cannot be the complete list of primes, because if so m must also be a prime. Since this contradicts the assumption it means there cannot exist such a complete list of primes; therefore the number of primes must be infinite!
Your mathematician friend Wannabe_Fermat has come up with a conjecture which he keeps telling to anyone who is willing to lend an ear: "The number m that we come up with when multiplying any n distinct prime numbers and adding 1 to this result is also a prime". You as Wannabe_Zuckerburg, are becoming jealous as your friend's conjecture is gaining popularity and decide to come up with a program that finds counterexamples to shut him up forever.
Input
The first line contains T, the number of testcases. Each testcase consists of two lines, the first line containing the number n  the number of primes in our list, and second line containing n spaceseparated prime numbers. Moreover, following things can be safely assumed:
1 <= T <= 10
n will be atmost 9 and m can be contained in 32bits.
Output
For each input case x, the output is of the format "Case #x: y", where y = m if m is a prime, else y is the largest prime factor of m.
Example
Input: 2
3
2 3 5
4
2 7 5 11
Output: Case #1: 31
Case #2: 257
Explanation:
Case #1  31 is a prime number
Case #2  2*5*7*11 + 1 = 771, which can be written as 3*257.
hide comments
loverboy:
20160409 14:10:31
got AC in one go :)


newbie:
20151020 00:50:54
1 silly mistake cost me 5 wa. anyway got AC ;) 

newbie:
20151020 00:32:01
can n be 0 ? 

BadeMeow:
20150812 10:16:49
Ignore Himanshu's comment.


:.Mohib.::
20150628 22:28:08
Just love primes..!! Nice one!! 

Vamsi Krishna Avula:
20141029 09:07:22
3s for this problem is very lenient, good problem btw. 

Rajat (1307086):
20140813 22:35:11
Brute forcing in a clever way was all that was needed to terminate dis.......... 

ivar.raknahs:
20140510 16:47:46
Accepted in first attempt.


Amitayush Thakur:
20130920 08:02:59
0.00 AC in one go :D 

shinchan:
20130913 10:27:38
please tell me what does it mean by "m can be contained in 32 bits" 
Added by:  Siddharth Kothari 
Date:  20110925 
Time limit:  0.722s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  own 