영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)
시간 제한 1초 · 메모리 제한 512 MB
Problem
List A consists of n positive integers, and list B contains the sum of each element pair of list A.
For example, if A=[1,2,3], then B=[3,4,5], and if A=[1,3,3,3], then B=[4,4,4,6,6,6].
Given list B, your task is to reconstruct list A.
Input
The first input line has an integer n: the size of list A.
The next line has (n(n-1))/2 integers: the contents of list B.
You can assume that there is a list A that corresponds to the input, and each value in A is between 1 … k.
Output
Print n integers: the contents of list A.
You can print the values in any order. If there are more than one solution, you can print any of them.
Constraints
- 3 ≤ n ≤ 100
- 1 ≤ k ≤ 10^9
Example
Explanation: In this case list A can be either [1,3,3,3] or [2,2,2,4] and both solutions are accepted.
예제
예제 1
4 4 4 4 6 6 6
1 3 3 3