#C9652. Increment List Elements
Increment List Elements
Increment List Elements
Given a list of integers and an integer \( n \), your task is to increment each element of the list by \( n \). This is a straightforward problem where you modify each element in the list with the formula:
\( a_i' = a_i + n \)
For example, if the list is [1, 2, 3] and \( n = 2 \), the output should be [3, 4, 5].
inputFormat
The input is given via standard input (stdin) and has three parts:
- The first line contains an integer \( T \) representing the number of elements in the list.
- The second line contains \( T \) space-separated integers representing the list elements. If \( T = 0 \), this line will be empty.
- The third line contains an integer \( n \) indicating the value to add to each element.
outputFormat
Print the modified list with each element incremented by \( n \) to standard output (stdout). The elements should be printed in order, separated by a single space. If the list is empty, output an empty line.
## sample3
1 2 3
2
3 4 5
</p>