atcoder#ARC130E. [ARC130E] Increasing Minimum
[ARC130E] Increasing Minimum
Score : points
Problem Statement
Consider doing the operation below on a sequence of positive integers to obtain a sequence .
- For each in this order, do the following.- Choose an such that .
- Let .
- Add to .
- Choose an such that .
- Let .
- Add to .
You are given integers , , and a sequence .
Determine whether there exists a sequence of positive integers for which it is possible to obtain from the operation. If it exists, find the lexicographically smallest such sequence.
Constraints
Input
Input is given from Standard Input in the following format:
Output
If there is no sequence of positive integers for which it is possible to obtain from the operation, print -1
.
If it exists, print the lexicographically smallest among such sequences , in one line, with spaces in between.
4 6
1 1 4 4 2 1
1 3 3 2
Some of the sequences for which it is possible to obtain from the operation are and . The lexicographically smallest among them is .
4 6
2 2 2 2 2 2
6 1 6 6
4 6
1 1 2 2 3 3
-1