시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 32 MB 658 562 521 86.689%

문제

수빈이는 심심해서 수열을 가지고 놀고 있다. 먼저, 정수 수열 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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nB1dCBjb250YWlucyB0aGUgc2VxdWVuY2Ugb2YgTiBzcGFjZS1zZXBhcmF0ZWQgaW50ZWdlcnMgQjxzdWI+aTxcL3N1Yj4gKDEgJmxlOyBCPHN1Yj5pPFwvc3ViPiAmbGU7IDEwPHN1cD45PFwvc3VwPikuJm5ic3A7PFwvcD5cclxuIiwib3V0cHV0IjoiPHA+VGhlIGZpcnN0IGFuZCBvbmx5IGxpbmUgb2Ygb3V0cHV0IG11c3QgY29udGFpbiBhIHNlcXVlbmNlIG9mIE4gc3BhY2Utc2VwYXJhdGVkIGludGVnZXJzIEE8c3ViPmk8XC9zdWI+LjxcL3A+XHJcblxyXG48cD5QbGVhc2Ugbm90ZSA6IHRoZSBpbnB1dCBkYXRhIHdpbGwgYmUgc3VjaCB0aGF0IHRoZSBlbGVtZW50cyBmcm9tIHRoZSBzZXF1ZW5jZSBBIGFyZSBpbnRlZ2VycyAoMSAmbGU7IEE8c3ViPmk8XC9zdWI+ICZsZTsgMTA8c3VwPjk8XC9zdXA+KS4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

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

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