// Arup Guha
// 12/27/2018
// Solution to 2018 Dec Silver USACO Problem: Convention

import java.util.*;
import java.io.*;

public class convention {
	
	public static int n;
	public static int numbus;
	public static int bussize;
	public static int[] arrivals;
	
	public static void main(String[] args) throws Exception {
		
		// Get basic info.
		BufferedReader stdin = new BufferedReader(new FileReader("convention.in"));
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		n = Integer.parseInt(tok.nextToken());
		numbus = Integer.parseInt(tok.nextToken());
		bussize = Integer.parseInt(tok.nextToken());
		
		// Get arrival times and sort.
		arrivals = new int[n];
		tok = new StringTokenizer(stdin.readLine());
		for (int i=0; i<n; i++)
			arrivals[i] = Integer.parseInt(tok.nextToken());
		Arrays.sort(arrivals);
		
		// Solve and print out the result.
		PrintWriter out = new PrintWriter(new FileWriter("convention.out"));
		out.println(go());
		out.close();		
		stdin.close();		
	}
	
	public static int go() {
		
		int low = 0, high = 1000000000;
		
		// Just run a binary search.
		while (low < high) {
			int mid = (low+high)/2;
			if (canDo(mid))
				high = mid;
			else
				low = mid+1;
		}
		
		// This was the best value that worked.
		return low;
	}
	
	public static boolean canDo(int gap) {
		
		// bussize, numbus.
		int cur = 0;
		for (int i=0; i<numbus; i++) {
			
			int lastI = cur;
			
			// Fit as many cows on the bus as long as we don't run out of cows and
			// we have enough time and the bus doesn't fill...
			while (lastI<n && arrivals[lastI]-arrivals[cur]<=gap && lastI-cur<bussize)
				lastI++;
			
			// We did it!.
			if (lastI == n) return true;
			
			// Update first cow for next bus.
			cur = lastI;
		}
		
		// If we get here, we didn't get all the cows on.
		return false;
	}

}
