Problems

# Product of Array Except Self

# Product of Array Except Self

Given an array **in** of **n** integers. Build an array **out** such that `out`

is equal to the product of all the elements of _{i}**in** except `in`

. Solve it in O(_{i}**n**) and constant space complexity.

#### Input

First line contains number **n** (**1** < **n** ≤ `10`

). Second line contains ^{6}**n** integers, each number is not greater than **100** by absolute value.

#### Output

Print the **out** array. It is known that all printed values are not greater than **2** *`10`

by absolute value.^{9}

Input example #1

4 1 2 3 4

Output example #1

24 12 8 6

Input example #2

4 2 0 1 4

Output example #2

0 8 0 0