#P9057. [Ynoi2004] rpfrdtzls
[Ynoi2004] rpfrdtzls
Problem Description
Given , maintain a sequence of sequences . Initially, each contains one element .
There are operations in total:
- Modification: given , for all , insert the element to the front of sequence .
- Query: given , query .
Where .
For , $F((x_1, \dots, x_n), k) = F((x_2, \dots, x_n), \lfloor \frac{k}{x_1} \rfloor) + 1$.
Input Format
The first line contains three integers .
The next lines each describe an operation: denotes a modification operation, and denotes a query operation.
Output Format
For each query operation, output one line containing the answer.
5 20 10
1 4 4 166348285
2 2 5
2 1 5
1 1 2 10
1 4 4 3
1 4 5 6
2 5 5
1 5 5 1
1 2 3 1
2 5 5
2 5 5
2 3 4
2 3 3
2 4 5
2 4 4
1 2 5 5
1 5 5 9
1 1 4 5
2 5 5
2 1 4
4
5
2
3
3
4
2
5
2
2
8
Hint
Idea: nzhtl1477, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
Constraints: for of the testdata, , , and .
For of the testdata, .
For of the testdata, .
For another of the testdata, .
For the remaining of the testdata, there are no special restrictions.
Translated by ChatGPT 5