No.1108 Transposition
タグ : / 解いたユーザー数 481
作問者 :
trineutron
/ テスター :
Rute
Problem Statement
Shifting the pitch of an entire piece of music by a fixed interval, keeping it otherwise unchanged, is called transposition. There is a piece of music with $N$ notes, whose pitches are $T_1, T_2, \dots, T_N$. Find the pitch of each note after transposing this piece up by $H$ semitones. Here, a note having pitch $T_i$ means that it is $T_i$ semitones higher than the reference note $0$.
Input
$N\ H$ $T_1\ T_2\ \dots\ T_N$
The first line contains the number of notes $N$ and $H$.
The second line contains the pitch $T_i$ of each note.
All inputs are integers.
$1 \le N \le 100$
$-100 \le H \le 100$
$-100 \le T_i \le 100$
Output
Print the pitch of each note after transposition, separated by spaces. Print a newline at the end.
Sample
Sample 1
Input
5 1 2 0 -1 -5 -3
Output
3 1 0 -4 -2
Sample 2
Input
7 -12 2 4 6 9 11 14 9
Output
-10 -8 -6 -3 -1 2 -3
Sample 3
Input
1 100 100
Output
200
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。