Swimming Competition

No attempts yetTime limit1sMemory limit1024 MB

Problem

In Bitlandia, every pupil may take part in an open swimming competition. Registering in advance is not required, so the organisers never know beforehand how many pupils will show up.

This year the number of participating pupils is smaller than the number of swimlanes in Bitlandia, which is 500 000. The organisers decide to split the participants into smaller groups, each holding at least AA and at most BB participants.

To make the competition as fun as possible, the organisers also want the swimmers in each group to have speeds that are as similar as possible.

Write a program that divides the swimmers into groups so that the maximum, taken over all groups, of the absolute difference between the times of the slowest and the fastest swimmer in a group is as small as possible.

Input

The first line contains three integers: the number of participants NN, and the minimum AA and maximum BB number of swimmers allowed in each group.

Each of the next NN lines contains one time tit_i, the time a swimmer needs to complete the distance.

The input is always such that a valid division exists.

Output

Print a single integer: the smallest possible value of the maximum, over all groups, of the difference between the times of the slowest and the fastest swimmer.

Constraints

  • 2N10000002 \le N \le 1\,000\,000
  • 2AB5000002 \le A \le B \le 500\,000
  • 1ti10000001 \le t_i \le 1\,000\,000 for every ii