#K58332. List Modification with Maximum Addition

    ID: 30619 Type: Default 1000ms 256MiB

List Modification with Maximum Addition

List Modification with Maximum Addition

In this problem, you are given one or more lists of integers. For each list, your task is to create a new list where each element is the sum of the original element and the maximum element in that list. Formally, given a list (A = [a_1, a_2, \dots, a_n]), you need to produce a list (B) where (B[i] = a_i + M) for (i=1,2,\dots,n) and (M = \max{a_1,a_2,\dots,a_n}). If the list is empty (i.e. (n = 0)), output an empty line. This problem tests simple list processing and handling of edge cases.

inputFormat

The input is read from standard input. The first line contains an integer (T) representing the number of test cases. For each test case, the first line contains an integer (n) denoting the number of elements in the list. The next line contains (n) space-separated integers representing the elements of the list. If (n = 0), the corresponding line will be empty.

outputFormat

For each test case, output one line containing the modified list. The elements in the line should be space-separated. If the list is empty, output an empty line.## sample

1
3
4 5 2
9 10 7

</p>