#K71932. Increase Elements by N
Increase Elements by N
Increase Elements by N
You are given T test cases. For each test case, you are provided with an integer N and a list of integers.
Your task is to increase each element in the list by N and print the updated list.
The operation for a test case can be mathematically represented as:
\(a_i^{\prime} = a_i + N\) for each element \(a_i\) in the list.
Note that N can be positive, negative, or zero.
inputFormat
The first line contains an integer T
indicating the number of test cases.
For each test case, the input consists of two lines:
- The first line contains two integers
N
andM
, whereN
is the value to add andM
is the number of elements in the list. - The second line contains
M
space-separated integers.
All input should be read from standard input (stdin).
outputFormat
For each test case, output a single line containing the updated list of integers after each element has been increased by N
. The numbers should be separated by a single space.
All output should be written to standard output (stdout).
## sample4
3 5
1 2 3 4 5
-2 4
6 7 8 9
1 10
0 1 2 3 4 5 6 7 8 9
100 5
-1000 -1000 -1000 -1000 -1000
4 5 6 7 8
4 5 6 7
1 2 3 4 5 6 7 8 9 10
-900 -900 -900 -900 -900
</p>