시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
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+MTxcL3N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