#P10158. [LSOT-2] 笼中鸟
[LSOT-2] 笼中鸟
Background
"Caged bird, caged bird"
"There is a tiny bird in the cage"
"When can it escape the prison cage"
"Night at dawn"
"Even the crane and the spirit turtle slip"
"Guess who is behind you"
Problem Description
Enomoto is experimenting with a mysterious transfer device in SPHIA’s small dark room.
There are sequences of length . He wants to verify whether the transfer device can run correctly on these sequences.
The main function of this device is to swap parts of two sequences. That is, it will choose , and then swap the segment of sequence with the segment of sequence .
Of course, to verify whether the swap is successful, he will query whether the sum of some interval of a sequence matches the expected value. Also, to avoid randomness, he will add a value to some interval of a sequence.
Enomoto knows that self likes the Fibonacci sequence very much, so to better trap self, he added another function: to determine whether an interval of a sequence is a special sequence satisfying .
Formal statement:
-
Given , compute .
-
Given , ask whether the proposition $\forall i\in[l+f,r],a_{x,i}\equiv \sum_{j=1}^f a_{x,i-j}\pmod p$ is true.
-
Given , .
-
Given , .
Input Format
The first line contains four positive integers , where is the number of operations.
The next lines each contain integers. The -th number in the -th line represents .
The next lines each contain four or five integers.
If the input is 1 x l r, it means performing operation on interval . If the input is 2 x l r f, it means performing operation on interval . If the input is 3 x l r k, it means performing operation on interval . If the input is 4 x y l r, it means performing operation on interval .
Output Format
For each operation , output one positive integer per line as the answer.
For each operation , if the proposition is true output where is self?, otherwise output infinity loop!.
5 2 6 1000000007
1 1 2 3 5
0 0 0 0 0
1 1 2 3
1 2 2 3
2 1 1 5 2
4 1 2 2 3
1 1 1 4
1 2 1 4
3
0
where is self?
4
3
Hint
"This problem uses bundled testcases."
.
.
there is no operation .
no special properties.
For all testdata, , , , , , , . It is guaranteed that is a randomly generated prime between and .
After the contest on 2024/2/13, two sets of hack data (Subtask #5) were added.
Translated by ChatGPT 5