#P7606. [THUPC 2021] 混乱邪恶
[THUPC 2021] 混乱邪恶
Background
Problem setters are divided into alignments: Lawful Good, Lawful Neutral, Lawful Evil, Neutral Good, True Neutral, Neutral Evil, Chaotic Good, Chaotic Neutral, and Chaotic Evil. A true problem setter must be able to switch between alignments constantly without getting lost in the realm.
The realm is an infinitely large triangular grid. The grid is shown in the figure below. Each intersection point has adjacent intersection points. You start from some intersection point, and each time you assign a style to a problem-setting idea, you move one step in the realm.

Problem Description
Each problem setter has a Lawfulness index and a Goodness index . For an idea, from the perspective of the statement, samples, or constraints, you must choose exactly one of the directions as the unique style of the problem corresponding to this idea, and you will move one step in the realm along the selected arrow direction:

Now you have a total of ideas. You know how your index and index change when you assign a certain style to each idea. Specifically, for the -th idea, there are parameters $tl_{i,l},tl_{i,g},l_{i,l},l_{i,g},bl_{i,l},bl_{i,g},br_{i,l},br_{i,g},r_{i,l},r_{i,g},tr_{i,l},tr_{i,g}$:
If you choose “a concise statement”, then becomes , and becomes .
If you choose “ordinary and useless samples”, then becomes , and becomes .
If you choose “loose constraints”, then becomes , and becomes .
If you choose “a complex statement”, then becomes , and becomes .
If you choose “selfless gifted samples”, then becomes , and becomes .
If you choose “super super super loose constraints”, then becomes , and becomes .
All additions here are performed modulo .
The requirements to enter the Chaotic Evil alignment are very strict: must be exactly equal to and must be exactly equal to .
Initially, both your index and index are . Determine whether there exists a way to assign styles such that after assigning styles to all ideas, you are still at the original position in the realm, and you can enter the Chaotic Evil alignment.
Input Format
The first line contains two positive integers .
The next lines each contain non-negative integers $tl_{i,l},tl_{i,g},l_{i,l},l_{i,g},bl_{i,l},bl_{i,g},br_{i,l},br_{i,g},r_{i,l},r_{i,g},tr_{i,l},tr_{i,g}$. The order of the parameters is the same as in the problem description, and no additional checking is needed.
The last line contains two non-negative integers .
Output Format
If possible, output one line Chaotic Evil.
If not possible, output one line Not a true problem setter.
3 10
3 5 1 4 9 3 0 0 0 0 0 0
0 0 0 0 0 0 3 5 1 4 9 3
3 5 1 4 9 3 3 5 1 4 9 3
3 2
Chaotic Evil
Hint
Sample Explanation
Assign the style “a concise statement” to the -st idea. Then your Lawfulness index becomes and your Goodness index becomes . You move one step to the upper-left.
Assign the style “loose constraints” to the -rd idea. Then your Lawfulness index becomes and your Goodness index becomes . You move one step to the lower-left.
Assign the style “selfless gifted samples” to the -nd idea. Then your Lawfulness index becomes and your Goodness index becomes . You move one step to the right. Now you are back at the origin, and your Lawfulness index is and your Goodness index is . Therefore, you can enter the Chaotic Evil alignment.
Constraints
It is guaranteed that and .
It is guaranteed that all other input data are between and .
Source
From the 2021 Tsinghua University Student Programming Contest and Collegiate Invitational (THUPC2021).
Resources such as editorials can be found at https://github.com/yylidiw/thupc_1/tree/master.
Translated by ChatGPT 5