| Author: | Pavel Mesenev | Time limit: | 2 sec | |
| Input file: | Standard input | Memory limit: | 256 Mb | |
| Output file: | Standard output |
You are given an array a0, a1, …, an − 1 of integers, which may include zero and negative values. For every index i, output the product of every element except ai (the product of an empty set of factors, when n = 1, is 1).
You may not use division.
The first line contains one integer n. The second line contains n space-separated integers a0… an − 1.
Print n space-separated integers: the answer for each index, in order.
1 ≤ n ≤ 800
− 50 ≤ ai ≤ 50
| No. | Standard input | Standard output |
|---|---|---|
| 1 |
|
|
| 2 |
|
|
| 3 |
|
|