#C1408. Product Except Self

    ID: 43689 Type: Default 1000ms 256MiB

Product Except Self

Product Except Self

Given an array of integers, compute an output array such that the element at index i is equal to the product of all the elements in the input array except the one at index i. This must be done without using division.

For an array \(A\) of length \(n\), the expected output is defined as:

$$ answer[i] = \prod_{\substack{0 \leq j < n \\ j \neq i}} A[j] $$

Your solution should read the input from stdin and print the result to stdout as space-separated integers.

inputFormat

The first line contains a single integer n representing the number of elements in the array. The second line contains n space-separated integers, which are the elements of the array.

outputFormat

Output a single line with n space-separated integers. The ith integer should be the product of all the elements of the input array except the one at index i.

## sample
4
1 2 3 4
24 12 8 6

</p>