Stevie : "Integer sequences, that's my main activity off the pitch. Let's play with them". Great defenders are an asset to any team, just like this guy :
You are given a sequence of positive integers in the form of an array A of size N and a number K. Now, you need to perform a certain procedure over this sequence that is as follows :
For each pair , where store in a list
Sort this list in non-decreasing order
Print the element of this list (1 indexed)
Note that X denotes the absolute value of any integer X
You need to perform the following procedure and print to output whatever it leads to. Can you do it ?
input Format :
The first line contains 2 space separated integers N and K respectively. The next line contains N space separated integers, where the integer denotes .
Output Format :
Print the required answer on a single line.
Constraints :
, where
The List we create after sorting it is :
As you may observe the element of this 3. So, clearly the answer is 3.