#P10733. [NOISG 2019 Prelim] Lost Array
[NOISG 2019 Prelim] Lost Array
Background
Translated from NOISG2019 Prelim B.Lost Array.
This problem uses Special Judge. Any answer that satisfies the conditions will be considered correct.
Problem Description
Given relations of the form , construct an array of length such that every number in the array is between and , and the array satisfies all relations.
It is guaranteed that such an array exists.
Input Format
The first line contains two integers .
The next lines each contain three numbers .
Output Format
Output one line with integers, representing the array you construct.
2 1
2 1 7
9 7
5 6
1 2 1
3 5 4
1 5 3
1 3 3
2 3 1
2 4 1
3 1 4 1 5
2 5
1 2 1
2 1 1
1 2 1
1 2 1
2 1 1
1 114514
5 1
1 2 123
123 1000000000 3 4 26311337
Hint
Sample #1 Explanation
Clearly, , which satisfies the conditions.
Sample #3 Explanation
The original statement did not include this sample, but it exists in the testdata.
The first constraint is . In fact, all constraints are the same as this one.
Sample #4 Explanation
The only constraint is . The other numbers can be any values between and .
Constraints
| Score | Special Property | |
|---|---|---|
| Samples | ||
| None | ||
For of the data:
- .
- .
- .
- .
Translated by ChatGPT 5