Vova has planted a row of N different plants that need to be grown for M days. At the end of these days, Vova will sell all the plants. Unfortunately, if they are grown without any special care, the final value of each will be 0.
While browsing the internet, he found a great deal — an emitter, and at a very good price! It is needed to increase the value of the plants — if the j-th plant in the row is irradiated on the i-th day, its value will increase by aij.
On the very first day of planting the plants, a worker arrived to install the emitter. But before that, he informed Vova of several characteristics:
-
The length of the emitter L, meaning it can irradiate L consecutive plants;
-
The emitter can be moved in the middle of the day; if this is done, the plants will be irradiated at both the previous and new positions. This can only be done once a day. The increase in value for a plant irradiated for half a day is the same as for a full day;
-
If the emitter is not moved, it will continue to irradiate the plants at the same positions;
-
The emitter brought to Vova can be installed anywhere by the worker, after which Vova can move the emitter himself, but no more than K times, otherwise it will break. It should be noted that Vova can move the emitter on the first day (the day of installation).
This is all very difficult and unclear, so Vova asked you to help him find the maximum possible sum he can earn from selling these plants after M days using this emitter.
Input
The first line contains four integers N, M, L, and K — the number of plants in the row, the number of days for growing these plants, the length of the emitter, and the number of possible moves of the emitter (1 ≤ N ≤ 5 000, 1 ≤ M ≤ 100, 1 ≤ L ≤ N, 0 ≤ K ≤ M).
The following M lines contain N integers aij — the increase in value of the j-th plant irradiated on the i-th day (0 ≤ aij ≤ 109).
Output
Output the maximum possible sum that can be earned from selling all the plants after M days.
Sample
| input | output |
|---|
3 4 2 1
3 2 0
4 1 1
0 3 7
2 1 1
| 23
|
Notes
In the example, the worker should install the emitter so that the first and second plants are irradiated. In the middle of the second day, Vova should move the emitter so that the second and third plants are irradiated. Thus, the value of the first plant will be 3 + 4 = 7, the value of the second will be 2 + 1 + 3 + 1 = 7, and the value of the third will be 1 + 7 + 1 = 9.
Problem Author: Vladimir Cherepanov
Problem Source: University academic school olympiad in informatics 2024