#K38857. Maximal Pens Distribution
Maximal Pens Distribution
Maximal Pens Distribution
In a contest, each participant initially receives a certain number of pens. In order to ensure fairness, the organizers decide to equalize the number of pens for all participants in each test case by giving extra pens so that every participant ends up with the maximum number of pens that any participant originally had.
Given several test cases, each test case provides an integer n representing the number of participants, followed by n integers indicating the initial number of pens each participant has. Your task is to determine the number of pens each participant will have after the distribution, which is simply the maximum value among the initial counts repeated n times.
The mathematical formulation for each test case is as follows:
$$result = \left[\max\{a_1, a_2, \dots, a_n\}, \max\{a_1, a_2, \dots, a_n\}, \dots, \max\{a_1, a_2, \dots, a_n\}\right]\text{ (n times)} $$inputFormat
The first line of input contains an integer T denoting the number of test cases. For each test case, the input consists of:
- An integer n representing the number of participants.
- A line with n space-separated integers representing the initial pen counts for each participant.
All input is read from standard input (stdin).
outputFormat
For each test case, output one line containing n space-separated integers, where each integer is the maximum pen count among the participants in that test case. All output should be written to standard output (stdout).
## sample2
3
1 2 3
4
4 4 4 4
3 3 3
4 4 4 4
</p>