#abc170c. [abc170_c]Forbidden List
[abc170_c]Forbidden List
Problem Statement
Given are an integer and an integer sequence of length : .
Among the integers not contained in the sequence (not necessarily positive), find the integer nearest to , that is, find the integer whose absolute difference with is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
- are all distinct.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
6 5
4 7 10 6 5
Sample Output 1
8
Among the integers not contained in the sequence , the one nearest to is .
Sample Input 2
10 5
4 7 10 6 5
Sample Output 2
9
Among the integers not contained in the sequence , the ones nearest to are and . We should print the smaller one, .
Sample Input 3
100 0
Sample Output 3
100
When , the second line in the input will be empty. Also, as seen here, itself can be the answer.