#K43097. List Transformation
List Transformation
List Transformation
You are given a list of integers and a single integer value. Your task is to produce a new list in which each element is the sum of the corresponding element from the input list and the given integer. In mathematical terms, for an input list \(a = [a_1, a_2, \dots, a_n]\) and an integer \(v\), you should output the list \(b = [a_1 + v, a_2 + v, \dots, a_n + v]\).
For example, if the input list is [3, 1, 4, 1, 5, 9] and \(v = 10\), then the output should be [13, 11, 14, 11, 15, 19].
inputFormat
The input consists of three lines:
- The first line contains an integer \(n\), representing the number of elements in the list.
- The second line contains \(n\) space-separated integers.
- The third line contains an integer \(v\), the value to add to each element of the list.
outputFormat
Output a single line with the transformed list as space-separated integers. If the list is empty (i.e., \(n = 0\)), output nothing.
## sample6
3 1 4 1 5 9
10
13 11 14 11 15 19