#P15823. [JOI Open 2013] Watching

    ID: 15761 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>动态规划 DP2013二分JOI(日本)

[JOI Open 2013] Watching

Description

There are many interesting cultures in Australia such as various sports and various kinds of animals. You are trying to watch many events held on a road in Brisbane.

The road is separated into 10000000001\,000\,000\,000 sections. The sections are numbered 1,2,,10000000001, 2, \dots, 1\,000\,000\,000 from west to east. You want to watch NN events. The ii-th event will be held on the section AiA_i.

In order to watch the events, you prepared PP small cameras and QQ large cameras. You can choose a positive integer ww as a parameter for taking pictures. Then, a small camera can take a picture of at most ww consecutive sections, and a large camera can take a picture of at most 2w2w consecutive sections. Pictures of a section can be taken by more than one cameras. You want to take pictures of all the sections of the events. Since it is expected many people will visit the events, for the sake of safety, you have to fix the positions of the cameras and it is not allowed to move them during the events. The larger the parameter ww is, the higher the cost to take pictures is. So, you want to minimize the value of ww.

Task

Write a program that, given information of the events and the number of cameras, determine the minimum value of ww so that the pictures of all the sections of the events can be taken.

Input Format

Read the following data from the standard input.

  • The first line of input contains three space separated integers N,P,QN, P, Q, where NN is the number of the events, PP is the number of small cameras, and QQ is the number of large cameras.
  • The ii-th line (1iN1 \le i \le N) of the following NN lines contains an integer AiA_i, the section where the ii-th event will be held.

Output Format

To the standard output, write the minimum value of ww so that the pictures of all the sections of the events can be taken.

3 1 1
2
11
17
4
13 3 2
33
66
99
10
83
68
19
83
93
53
15
66
75
9

Hint

Sample Explanation

In this example, when you choose w=4w = 4, you can take pictures of all the sections of the events. For example, you can take pictures from the section 1 to 3 by a small camera, and you can take pictures from the section 11 to 18 by a large camera.

Constraints

All input data satisfy the following conditions.

  • 1N20001 \le N \le 2000.
  • 1P1000001 \le P \le 100\,000.
  • 1Q1000001 \le Q \le 100\,000.
  • 1Ai10000000001 \le A_i \le 1\,000\,000\,000 (1iN1 \le i \le N).

Subtask

Subtask1 [50 points]

  • N100N \le 100 is satisfied.

Subtask2 [50 points]

There are no additional constraints.