Logo
(追記) (追記ここまで)

31312번 - Water Journal 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB38119918753.125%

문제

Every day, Eugene logs how many cups of water he drank. He forgot to log one entry in his journal though, but he remembers the minimum number and maximum number of cups of water he drank every day since he started logging his journal, and that there was at least one day where he drank the minimum and one day where he drank the maximum. Compute all possible amounts of cups of water he could have imbibed on the day he forgot to log.

입력

The first line of input contains three integers $n$ (2ドル \le n \le 50$), $a$ and $b$ (1ドル \le a \le b \le 50$), where $n$ is the number of days in Eugene's log, $a$ is the minimum number of cups of water he drank on any day, and $b$ is the associated maximum.

Each of the next $n-1$ lines contains a single integers $w$ ($a \le w \le b$). These are the entries in Eugene's log for every day except the day he forgot to log an entry.

출력

Output in increasing order, all of the possible values for the missing entry separated by whitespace, or simply output -1 if Eugene's memory is faulty and it isn't possible.

제한

예제 입력 1

5 1 5
1
2
4
5

예제 출력 1

1
2
3
4
5

예제 입력 2

5 1 5
1
2
3
4

예제 출력 2

5

힌트

출처

ICPC > Regionals > North America > North America Qualification Contest > ICPC North America Qualifier 2023 L번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /