def inpl(): return [int(i) for i in input().split()]
import bisect

N, K, Q = inpl()
A = inpl()
rng = [0, N+1]
B = [(i+1, v) for i, v in enumerate(A)]
B = sorted(B, key = lambda x: x[1])
maxi = max(rng[-1] - rng[0] - K, 0)
i = 0
while maxi >= Q:
    j = bisect.bisect_left(rng,B[i][0])
    bisect.insort_left(rng, B[i][0])
    maxi += max(rng[j+1]-rng[j]-K, 0)\
    + max(rng[j]-rng[j-1]-K, 0)\
    - max(rng[j+1]-rng[j-1]-K, 0)
    i += 1
D = len(rng) - 2
ans = float('inf')
for i in range(D):
    ans = min(ans, B[Q+i-1][1]-B[i][1])
print(ans)