#agc032e. [agc032_e]Modulo Pairing
[agc032_e]Modulo Pairing
Problem Statement
Let be a positive integer.
You are given integers , where for each .
Consider dividing the integers into pairs. Here, each integer must belong to exactly one pair.
We define the ugliness of a pair as . Let be the largest ugliness of the pairs. Find the minimum possible value of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum possible value of , where is the largest ugliness of the pairs.
Sample Input 1
3 10
0 2 3 4 5 9
Sample Output 1
5
One solution is to form pairs and , with ugliness and , respectively.
Sample Input 2
2 10
1 9 1 9
Sample Output 2
0
Pairs and should be formed, with ugliness both .