#P9000. [CEOI 2022] Measures
[CEOI 2022] Measures
Problem Description
There are people standing on a number line. Their initial positions are , and they can move at a speed of unit length per second.
For well-known reasons, they need to keep social distance, meaning that the distance between any two people must be at least .
Alenka designed an app to quickly compute the minimum time needed for these people to achieve social distancing by moving. Now she wants to add a new feature: support dynamically adding a person at position .
You need to implement a program to complete this feature.
Input Format
The first line contains three integers .
The next line contains integers , representing the initial people.
The next line contains integers , representing the people added one by one in order.
Output Format
Output one line with numbers. The -th number represents the minimum time required after adding the -th person. You must output the exact value of this time, without extra trailing .
2 1 2
1 3
2
1
0 5 3
1 2 3 4 5
0 1 2 3 4
3 3 3
3 3 3
3 3 3
4.5 6 7.5
Hint
Explanation for Sample 2

Constraints
For all testdata, .
| Subtask ID | Special Constraints | Score |
|---|---|---|
| , | ||
| , | ||
| ,, | ||
| , |
Translated by ChatGPT 5