cho.sh
Notes
Loading...

Sequence Transformation

Time limit

2s

Memory limit

128 MB

Problem

You are given a sequence A of length N. In one transformation, create a new sequence from the differences of adjacent elements. The new sequence B has length one less than the previous sequence, and B[i] = A[i+1] - A[i].

Given the initial sequence, output the sequence that remains after applying this transformation K times.

Input

The first line contains N and K. N is a positive integer not greater than 20, and K is an integer from 0 to N-1.

The second line contains N integers separated by commas (,). Each integer has absolute value at most 100.

Output

Print the sequence after K transformations on one line, with its values separated by commas (,).