#P8529. [Ynoi2003] 赫露艾斯塔
[Ynoi2003] 赫露艾斯塔
Background

Problem Description
Given distinct points , , and sets , .
You need to find a permutation of such that
$$|S_{p_1}|+\sum\limits_{i=2}^m |S_{p_i}\oplus S_{p_{i-1}}|\le M.$$is a given constant, and means .
Input Format
The first line contains two integers .
The next lines each contain two integers .
The next lines each contain three integers .
Output Format
Output lines, in order, representing .
5 3
2021 700
-9384 1031
2201 2561
4982 6255
-1700 388
-2151 1808 -4359815
-2850 -1980 7147359
-924 217 -8902828
2
1
3
Hint
Idea: nzhtl1477, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
Constraints for of the testdata:
.
.
.
.
.
In fact, the data is randomly generated.
Translated by ChatGPT 5