Sona's number sequence

2.7

17 votes
Medium-Hard
Problem

Sona is busy in organizing Port '16. Sona has to formulate two number sequence as two list. As she loves numbers she wrote the two number sequence in two different papers. Both the list have N numbers. She also named the number sequence as A and B where A = {a0,a1,...aN-1} and B = {b0,b1,..,bN-1} where as

b0 = a0/1

b1 = (a0+a1) / 2

b2 = (a0+a1+a2) / 3 and so on.

As she is busy in organizing Port '16 she lost the paper which had 'A' series paper. But she is confident that 'A' series can be generated from 'B' series by the above relation. You are provided with 'B' series paper.

Your task is to print the elements of A series.

Input :

First line contain an integer N - size of list B

Second line contains N space separated integers - elements of list B

Output :

Output N space separated integers - elements of list A

constraints

1≤N≤100

1≤value_of_each_element_in_list B≤10^9

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?