5 6 1 3 5 6 8 3 1 2 1 2 3 1 3 1 2 5 3 3 1 3 1 1 3 1 2 5 5 2 3 1 5
16 25 84 Initially, $A=(1,3,5,6,8)$ and $B=(3,1,2,1,2)$. The queries are processed in the following order: * For the first query, print $(1\times 3)+(3\times 1)+(5\times 2)=16$ modulo $998244353$, which is $16$. * For the second query, add $3$ to $A_2,A_3,A_4,A_5$. Now $A=(1,6,8,9,11)$. * For the third query, print $(1\times 3)+(6\times 1)+(8\times 2)=25$ modulo $998244353$, which is $25$. * For the fourth query, add $1$ to $A_1,A_2,A_3$. Now $A=(2,7,9,9,11)$. * For the fifth query, add $2$ to $B_5$. Now $B=(3,1,2,1,4)$. * For the sixth query, print $(2\times 3)+(7\times 1)+(9\times 2)+(9\times 1)+(11\times 4)=84$ modulo $998244353$, which is $84$. Thus, the first, second, and third lines should contain $16$, $25$, and $84$, respectively.
2 3 1000000000 1000000000 1000000000 1000000000 3 1 1 1 2 2 1000000000 3 1 2
716070898 151723988 Make sure to print the sum modulo $998244353$ for the third type of query.
{
"problem": {
"name": "Two Sequence Queries",
"description": {
"content": "You are given sequences of length $N$, $A=(A_1,A_2,\\ldots,A_N)$ and $B=(B_1,B_2,\\ldots,B_N)$. You are also given $Q$ queries to process in order. There are three types of queries: * `1 l r x` : A",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 5000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc357_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given sequences of length $N$, $A=(A_1,A_2,\\ldots,A_N)$ and $B=(B_1,B_2,\\ldots,B_N)$. \nYou are also given $Q$ queries to process in order.\nThere are three types of queries:\n\n* `1 l r x` : A...",
"is_translate": false,
"language": "English"
}
]
}