I saw this on AIO 2020 and have no idea.
On an interval ranged 1 ~ L there are N segments (Ai, Bi) You can add at most k extra segments with length X. What is the longest continuous interval you can get that is covered by segments?
2 <= L <= 10^9 0 <= k <= 10^9 N <= 10^5
some sample: