#K10106. Array Modification Challenge

    ID: 23173 Type: Default 1000ms 256MiB

Array Modification Challenge

Array Modification Challenge

You are given an array of integers of size N. Your task is to modify the array such that each element ai is replaced by the sum of all the other elements of the array.

In other words, if the sum of all elements is S, then the new value for each element ai is computed using the formula:

$$a'_i = S - a_i$$

You need to process multiple test cases from the standard input.

inputFormat

The input is read from standard input and has the following format:

  • The first line contains an integer T representing the number of test cases.
  • For each test case, the first line contains an integer N representing the number of elements in the array.
  • The following line contains N space-separated integers.

outputFormat

For each test case, output a single line containing the modified array. The elements should be output in order, separated by a space.

## sample
1
3
1 2 3
5 4 3

</p>