#P8963. 「WHOI-4」加减法构造
「WHOI-4」加减法构造
Problem Description
Little W gives you an integer array of length . You need to construct an integer array of length , and satisfy:
- , where is an integer that you must choose.
- Minimize .
- , where is a number given in the input.
Input Format
The first line contains two integers .
The next line contains integers; the -th integer represents .
Output Format
The first line contains two integers , representing the value you choose and your answer.
The next line contains integers; the -th integer represents .
It is guaranteed that the minimum value of fits in long long.
5 10
2 3 8 5 4
-1 6
2 3 4 5 6
7 100
11 45 14 19 19 8 10
-17 51
16 15 14 13 12 11 10
Hint
Constraints
- Subtask 1 ( pts): , , .
- Subtask 2 ( pts): , , .
- Subtask 3 ( pts): , , .
- Subtask 4 ( pts): , , .
- Subtask 5 ( pts): , , .
For all testdata, it is guaranteed that , , .
Notes about the Special Judge
For each test point:
If your output format is incorrect, you will get points.
If any number you output is not in the range , you will get points.
If your sequence does not match the you output, you will get points.
If your sequence does not match the you output, you will get points.
Otherwise, the score you get for this test point is percent of the total score for this test point, where is the value of the best answer.
Translated by ChatGPT 5