Water Journal
시간 제한1초메모리 제한2048 MB
n, 최솟값 a, 최댓값 b와 n-1개의 기록이 주어질 때 빠진 하루의 값이 될 수 있는 모든 수를 출력하거나 -1을 출력한다.
문제
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 (), and (), where is the number of days in Eugene's log, is the minimum number of cups of water he drank on any day, and is the associated maximum.
Each of the next lines contains a single integers (). 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.