#P10153. 「LAOI-5」膜你赛
「LAOI-5」膜你赛
Background
LAOI members created a CSP-J mock contest with problems.
2025.1.24 The idea of this problem comes from xzCyanBrad.
Problem Description
The contest uses the ICPC rules: first sort by the number of solved problems in non-increasing order, then sort by the total penalty time in non-decreasing order.
There are top players coming to speedrun this contest, and the contest lasts minutes in total.
At the beginning of minute (), player first submits WA submissions (each adds minutes of penalty), and then solves one problem. So their solved count increases by , and their total penalty time increases by minutes.
Player has a total of WA submissions and solves problems (it is guaranteed that ). Why did they not finish all problems? Because they thought the problems were too easy and not interesting, so they left.
If player finds that they are in first place on the leaderboard (no ties allowed) after finishing all of their submissions, then we say they "speedrun the contest."
Construct sequences and such that player has exactly WAs and solves exactly problems, and the number of players who "speedrun the contest" is as large as possible.
Input Format
There are three lines in total.
The first line contains three integers .
The second line contains integers, representing .
The third line contains integers, representing .
Output Format
Output the maximum number of players who "speedrun the contest" on the first line.
On the second and third lines, output one optimal construction:
The second line contains integers, representing .
The third line contains integers, representing .
3 9 20
3 3 3
0 1 2
3
3 3 3 2 2 2 1 1 1
1 0 1 0 1 0 0 0 0
3 16 3
5 5 6
2 0 8
3
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3
0 0 1 0 0 1 1 0 2 1 0 2 0 0 1 1
Hint
Sample 1 Explanation
At minute , player finishes submitting, solves problems, and has penalty time minutes.
At minute , player finishes submitting, solves problems, and has penalty time minutes.
At minute , player finishes submitting, solves problems, and has penalty time minutes.
Constraints
The testdata is not guaranteed to be random.
This problem uses bundled tests.
| Subtask ID | Score | |
|---|---|---|
| ,, | ||
| , | ||
| , | ||
| , | ||
| No special limits. |
For of the testdata, it is guaranteed that:
- ;
- ;
- ;
- ;
- ;
- ;
- 。
Translated by ChatGPT 5