Chief Thief

subeen SCB-PA Inter School and C...
Limits 1s, 512 MB

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 $i$-th number is the summation of all the numbers except the $i$-th number in the input. Hence, if the input numbers are $1, 2, 3, 4$, output will be, $9, 8, 7, 6$. 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 $1, 2, 3, 4$, output will be $24, 12, 8, 6$.


Next line will have n integers, where maximum value of an integer will be $10^5$.


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 $2^{31}$.


1 2 3 4
24 12 8 6


Login to submit.



53% Solution Ratio
sbduke73Earliest, Nov '18
ShimolFastest, 0.0s
Tareq_AbrarLightest, 655 kB
Nusab19Shortest, 140B
Toph uses cookies. By continuing you agree to our Cookie Policy.