#P6092. [CEOI 2012] 工作规划
[CEOI 2012] 工作规划
Description
CEOI received tasks over days. Each task needs machine working for day to be completed. CEOI has many machines, and each machine can complete at most one task per day. CEOI requires that each task can be delayed by at most days. In other words, if a customer submits a task on day , CEOI must finish it by day .
Please write a program to find the minimum number of machines needed to complete all tasks on time, under the constraint that each task can be delayed by at most days.
Input Format
The first line contains three integers: is the number of days during which CEOI receives tasks, is the maximum number of days each task can be delayed, and is the number of tasks.
The second line contains integers separated by spaces. The -th number represents the day when the -th task is received. There are no tasks after day . All tasks are numbered from to in order of the input.
Output Format
Output one integer, the minimum number of machines that can complete the tasks.
8 2 12
1 2 4 2 1 3 5 6 2 3 6 4
2
Hint
For of the testdata, .
For all testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号