A group of thieves steal only money. Every morning they deposit the money to their leader. The leader of the thieves recently bought a computer (or stole from somewhere?). He wants a program that he can use to track the money deposited by all members. Hence he asked a programmer to write a program for him, that can find the total amount deposited by all thieves.
The programmer wrote a simple program. As he didn't know for which thief the leader didn't want calculate the amount, he made his program flexible. It takes a list of numbers as input and outputs another list. In the output, the -th number is the summation of all the numbers except the -th number in the input. Hence, if the input numbers are , output will be, . But the chief thief (leader) didn't like the program, He asked the programmer, why don't you multiply all the numbers instead of adding? The programmer knows it doesn't make any sense, but he also doesn't want to loose the money he will get for his program, he is asking for your help to write it for you.
According to the formula of chief thief, if the input is , output will be .
Next line will have n integers, where maximum value of an integer will be .
Output will consists of n integers separated by spaces. There shouldn’t be any space character after the last number.
It's guaranteed that each integer in the output will be less than .
4 1 2 3 4
24 12 8 6
Login to submit