Given a positive integer , Bob needs to find the minimum positive integer
so that
.
Since is huge, Bob will give you
integers, denoted as
, such that
, where
is the
-th smallest prime number. It is guaranteed that
Input Specification
The first line of input contains an integer
, the number of test cases.
Each of the following blocks contains two lines of input. The first line contains an integer
, the number of prime factors. The second line contains
integers
, indicating the
-th prime's exponent.
Output Specification
Output one integer for each test case, the smallest positive integer so that
.
Constraints
Subtask | Points | Additional constraints |
---|---|---|
No additional constraints. |
Sample Input
1
5
1 1 1 1 1
Sample Output
11
Explanation
, and the minimum
is
.
Comments