#K76662. Product of Array Elements

    ID: 34693 Type: Default 1000ms 256MiB

Product of Array Elements

Product of Array Elements

You are given T test cases. For each test case, you are provided with an integer N and an array of N integers. Your task is to compute the product of the elements in the array.

For each test case, if the array elements are denoted by \(a_1, a_2, \dots, a_N\), you need to compute the product:

\(\prod_{i=1}^{N} a_i\)

Print the result for each test case on a new line.

inputFormat

The input is given in the following format:

T
N
a1 a2 ... aN
... (this repeats for T test cases)

Where:

  • T is the number of test cases.
  • For each test case, N represents the number of integers in the array followed by N space-separated integers.

outputFormat

For each test case, output a single line containing the product of the numbers in the corresponding array.

## sample
1
3
2 3 4
24

</p>