Time Limit: 8 seconds
Memory Limit: 32 MB
On a line there are
If a lantern at coordinate
Lanterns can only be turned on in bursts:
- You may perform at most
$t$ bursts. - You may perform fewer than
$t$ bursts (possibly$0$ ), but the goal is still to illuminate every outpost. - In one burst, you choose a contiguous block of lantern indices
$[l..r]$ ($1$ -based) and turn on all lanterns$b_l, b_{l+1}, \dots, b_r$ . - The activation effort of a burst equals its length
$r-l+1$ . - The total activation effort is the sum of burst lengths over all bursts, and it must be at most
$k$ . (Bursts may overlap; overlapping indices still contribute again to the effort.)
Find the minimum integer radius
Input Format:-
The first line contains four integers
The second line contains
The third line contains
Output Format:-
Print one integer: the minimum possible radius
Constraints:-
$1 \le n, m \le 100000$ $1 \le k \le m$ $1 \le t \le 30$ $-10^9 \le a_i, b_j \le 10^9$ - Arrays
$a$ and$b$ are sorted non-decreasing
Examples:-
- Input:
4 2 1 1
0 0 1 1
0 2
- Output:
1
- Input:
4 3 2 2
-3 -1 1 3
-2 0 2
- Output:
1
Note:-
In the first example, we may use one burst (since
Choosing the lantern at
In the second example, we can use up to
With radius