시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 32 MB 498 429 399 87.500%

문제

수빈이는 심심해서 수열을 가지고 놀고 있다. 먼저, 정수 수열 A를 쓴다. 그리고 그 아래에 정수 수열 A의 해당 항까지의 평균값을 그 항으로 하는 정수 수열 B를 쓴다. 

예를 들어, 수열 A가 1, 3, 2, 6, 8이라면, 수열 B는 1/1, (1+3)/2, (1+3+2)/3, (1+3+2+6)/4, (1+3+2+6+8)/5, 즉, 1, 2, 2, 3, 4가 된다. 

수열 B가 주어질 때, 수빈이의 규칙에 따른 수열 A는 뭘까?

입력

첫째 줄에는 수열 B의 길이만큼 정수 N(1 ≤ N ≤ 100)이 주어지고, 둘째 줄에는 수열 Bi를 이루는 N개의 정수가 주어진다.(1 ≤ Bi ≤ 109)

출력

첫째 줄에는 수열을 이루는 N개의 정수를 출력한다. (1 ≤ Ai ≤ 109)

예제 입력 1

1
2

예제 출력 1

2

예제 입력 2

4
3 2 3 5

예제 출력 2

3 1 5 11

예제 입력 3

5
1 2 2 3 4

예제 출력 3

1 3 2 6 8
W3sicHJvYmxlbV9pZCI6IjEwNTM5IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjMjE4XHViZTQ4XHVjNzc0XHVjNjQwIFx1YzIxOFx1YzVmNCIsImRlc2NyaXB0aW9uIjoiPHA+XHVjMjE4XHViZTQ4XHVjNzc0XHViMjk0IFx1YzJlY1x1YzJlY1x1ZDU3NFx1YzExYyBcdWMyMThcdWM1ZjRcdWM3NDQgXHVhYzAwXHVjOWMwXHVhY2UwIFx1YjE4MFx1YWNlMCBcdWM3ODhcdWIyZTQuIFx1YmEzY1x1YzgwMCwgXHVjODE1XHVjMjE4IFx1YzIxOFx1YzVmNCBBXHViOTdjIFx1YzRmNFx1YjJlNC4mbmJzcDtcdWFkZjhcdWI5YWNcdWFjZTAgXHVhZGY4IFx1YzU0NFx1Yjc5OFx1YzVkMCBcdWM4MTVcdWMyMTggXHVjMjE4XHV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zIHRoZSBzZXF1ZW5jZSBvZiBOIHNwYWNlLXNlcGFyYXRlZCBpbnRlZ2VycyBCPHN1Yj5pPFwvc3ViPiAoMSAmbGU7IEI8c3ViPmk8XC9zdWI+ICZsZTsgMTA8c3VwPjk8XC9zdXA+KS4mbmJzcDs8XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5UaGUgZmlyc3QgYW5kIG9ubHkgbGluZSBvZiBvdXRwdXQgbXVzdCBjb250YWluIGEgc2VxdWVuY2Ugb2YgTiBzcGFjZS1zZXBhcmF0ZWQgaW50ZWdlcnMgQTxzdWI+aTxcL3N1Yj4uPFwvcD5cclxuXHJcbjxwPlBsZWFzZSBub3RlIDogdGhlIGlucHV0IGRhdGEgd2lsbCBiZSBzdWNoIHRoYXQgdGhlIGVsZW1lbnRzIGZyb20gdGhlIHNlcXVlbmNlIEEgYXJlIGludGVnZXJzICgxICZsZTsgQTxzdWI+aTxcL3N1Yj4gJmxlOyAxMDxzdXA+OTxcL3N1cD4pLiZuYnNwOzxcL3A+XHJcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

Contest > Croatian Open Competition in Informatics > COCI 2014/2015 > Contest #1 1번

  • 문제의 오타를 찾은 사람: tearsmore
  • 문제를 번역한 사람: yang