#C14057. Compute Sum and Product of an Array
Compute Sum and Product of an Array
Compute Sum and Product of an Array
Given an array of integers, you are required to compute the sum and the product of its elements. Formally, if the array is (A = [a_1, a_2, \ldots, a_n]), then you should calculate (S = \sum_{i=1}^{n} a_i) and (P = \prod_{i=1}^{n} a_i). Note that if the array is empty (i.e. (n=0)), you must output (0) for the sum and (1) for the product.
inputFormat
The input is given via standard input (stdin). The first line contains an integer n (\(n \geq 0\)), representing the number of elements in the array. If n > 0, the second line contains n space-separated integers representing the elements of the array.
outputFormat
Output the sum and the product of the array elements separated by a space on a single line to standard output (stdout).
## sample0
0 1