SP8281 INTCOMB - Combination Of Integers

Description

You will be given n positive integers a\_1, a\_2, ..., a\_n. We say that a nonnegative integer combination of these numbers is of the form a\_1\*b\_1 + a\_2\*b\_2 + ... + a\_n\*b\_n where each of b\_1, b\_2, ..., b\_n is a nonnegative integer. You are to determine how many positive integers cannot be expressed as a nonnegative integer combination of a\_1, a\_2, ..., a\_n.

Input Format

The first line contains a single integer denoting the number of test cases (about 30). Each test case consists of a single line. The first integer on the line is n, between 1 and 30, which indicates the number of integers a\_1, a\_2, ..., a\_n. Then n integers follow each between 1 and 100,000. The i'th such integer is a\_i. All integers on this line are separated by a space.

Output Format

For each test case you are to output a single line. If there are only a finite number of positive integers that cannot be expressed as a nonnegative integer combination of a\_1, a\_2, ..., a\_n, then you are to output this number. Otherwise, simply output the text "Infinite" (without quotes).