시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 16 1 1 100.000%

문제

집합 A = {a1, a2, a3, ..., an}, ai ∈ {0, 1, 2, 3, ...}과 여섯 방정식이 주어진다.

  • c1 = x1 + x2
  • x4 = x3 + x1
  • x5 = x6 + x7
  • x11 = x8 + x9
  • x6 = x2 + x10
  • x12 = x9 + c2

c1과 c2는 정수 상수이다. c1과 c2가 주어졌을 때, 방정식을 푸는 프로그램을 작성하시오. 즉, 모든 xi를 찾아야 한다. 또, 모든 xi는 A의 원소이어야 한다. 또, 항상 방정식을 풀 수 있는 경우만 입력으로 주어진다.

입력

첫째 줄에 n, c1, c2가 주어진다. 둘째 줄부터 n개 줄에는 ai가 주어진다. 12 ≤ n ≤ 7,000, ai는 32비트 정수이다.

출력

출력은 총 12줄이다. 첫 번째 줄에 x1, 두 번째 줄에 x2, ..., 열두번째 줄에 x12를 출력한다.

예제 입력 1

16 100 -30
100
70
30
10
80
42
53
95
17
35
52
12
5
77
89
1000

예제 출력 1

70
30
10
80
95
42
53
17
35
12
52
5

힌트

W3sicHJvYmxlbV9pZCI6Ijk3NDMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMjlcdWM4MTVcdWMyZGQgXHViZDgwXHVjMjE4XHVhZTMwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWM5ZDFcdWQ1NjkgQSA9IHthPHN1Yj4xPFwvc3ViPiwgYTxzdWI+MjxcL3N1Yj4sIGE8c3ViPjM8XC9zdWI+LCAuLi4sIGE8c3ViPm48XC9zdWI+fSwgYTxzdWI+aTxcL3N1Yj4gJmlzaW47IHswLCAxLCAyLCAzLCAuLi59XHVhY2ZjIFx1YzVlY1x1YzEyZiBcdWJjMjlcdWM4MTVcdWMyZGRcdWM3NzQgXHVjOGZjXHVjNWI0XHVjOWM0XHViMmU0LjxcL3A+XHJcblxyXG48dWw+XHJcblx0PGxpPmM8c3ViPjE8XC9zdWI+ID0geDxzdWI+MTxc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