The nflsM Tokens (HARD)
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
P1040 The nflsM Tokens (HARD)
Problem Background
See problem P1039 The nflsM Tokens (EASY) (Fib3 Queue 2).
Problem Statement
Define with .
Originally we have .
Given queries. Each query is formatted like these below:
1 x
means to make equal .2 n
means to ask you to print modulo with the current .
Input
For each query, it is formatted by two integers; more see problem statement.
Output
For each query with the operation, print the answer.
Constraints
- .
- For each query with the operation, .
- For each query with the operation:
- For test cases: .
- For all test cases: .