VK Cup 2012 Round 2 (Unofficial Div. 2 Edition)
A
Chores
Codeforces
800
原题
←B →
翻译中…

Petya and Vasya are brothers. Today is a special day for them as their parents left them home alone and commissioned them to do $*n*$ chores. Each chore is characterized by a single parameter — its complexity. The complexity of the $*i*$-th chore equals $*h*_{*i*}$.

翻译中…

As Petya is older, he wants to take the chores with complexity larger than some value $*x*$ ($*h*_{*i*} > *x*$) to leave to Vasya the chores with complexity less than or equal to $*x*$ ($*h*_{*i*} ≤ *x*$). The brothers have already decided that Petya will do exactly $*a*$ chores and Vasya will do exactly $*b*$ chores ($*a* + *b* = *n*$).

翻译中…

In how many ways can they choose an integer $*x*$ so that Petya got exactly $*a*$ chores and Vasya got exactly $*b*$ chores?

翻译中…

Input

翻译中…

The first input line contains three integers $*n*, *a*$ and $*b*$ ($2 ≤ *n* ≤ 2000$; $*a*, *b* ≥ 1$; $*a* + *b* = *n*$) — the total number of chores, the number of Petya's chores and the number of Vasya's chores.

翻译中…

The next line contains a sequence of integers $*h*_{1}, *h*_{2}, ..., *h*_{*n*}$ ($1 ≤ *h*_{*i*} ≤ 10^{9}$), $*h*_{*i*}$ is the complexity of the $*i*$-th chore. The numbers in the given sequence are not necessarily different.

翻译中…

All numbers on the lines are separated by single spaces.

翻译中…

Output

翻译中…

Print the required number of ways to choose an integer value of $*x*$. If there are no such ways, print 0.

翻译中…

Note

翻译中…

In the first sample the possible values of $*x*$ are 3, 4 or 5.

翻译中…

In the second sample it is impossible to find such $*x*$, that Petya got 3 chores and Vasya got 4.

翻译中…

样例

Input #1
5 2 3
6 2 3 100 1
Output #1
3
InputCopy OutputCopy
Input #2
7 3 4
1 1 9 1 1 1 1
Output #2
0
InputCopy OutputCopy
题目信息
题号
169A
时间限制
2 s
内存限制
256 MB
标签
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。