parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	n,k,q = readline() |> split |> parseMap
	a = readline() |> split |> parseMap
	b = Tuple{Int,Int}[(a[i],i) for i in 1:n]
	b = sort(b,by=x->x[1])
	ans = b[n][1]-b[1][1]
	ct = Int[0,n+1]
	for i in 1:n
		f = 0
		for j in 2:length(ct)
			f += max(ct[j]-ct[j-1]-k,0)
		end
		if f >= q
			ans = min(ans,b[i+q-1][1]-b[i][1])
		end
		push!(ct,b[i][2])
		ct = sort(ct)
	end
	println(ans)
end

main()