{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eDoctor Sunset is doing a survey about global warming. He selected two cities $$$A$$$ and $$$B$$$, and has gathered the average air temperature of these two cities throughout passed $$$n$$$ days. On the $$$i$$$-th day, the average air temperature of $$$A$$$ was $$$a_i$$$ while the average air temperature of $$$B$$$ was $$$b_i$$$.\u003c/p\u003e\u003cp\u003eDoctor Sunset drew a key graph using the temperature data. From his observation, there are several facts about the data:\u003c/p\u003e\u003cul\u003e \u003cli\u003e All the values are integers within $$$[1,n]$$$. \u003c/li\u003e\u003cli\u003e Global warming is ture, so the temperature is non-decreasing, which means $$$a_1\\leq a_2\\leq a_3\\leq\\dots\\leq a_n$$$ and $$$b_1\\leq b_2\\leq b_3\\leq\\dots\\leq b_n$$$. \u003c/li\u003e\u003cli\u003e City $$$B$$$ is always not hotter than $$$A$$$, which means $$$b_i\\leq a_i$$$ for all $$$i\\in[1,n]$$$. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eUnfortunately, Doctor Sunset erased all the data of city $$$B$$$ by mistake just now. But he can recover the array $$$b$$$ by the facts described above. Please write a program to help Sunset count the number of possible arrays that can be $$$b$$$.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains an integer $$$T(1\\leq T\\leq 100)$$$, denoting the number of test cases.\u003c/p\u003e\u003cp\u003eIn each test case, there is one integer $$$n(1\\leq n\\leq 2 \\times 10^5)$$$ in the first line, denoting the number of days.\u003c/p\u003e\u003cp\u003eIn the second line, there are $$$n$$$ integers $$$a_1,a_2,...,a_n(1\\leq a_i\\leq n)$$$, denoting the average air temperature of city $$$A$$$. The input is always valid, so you can assume $$$a_1\\leq a_2\\leq a_3\\leq\\dots\\leq a_n$$$.\u003c/p\u003e\u003cp\u003eIt is guaranteed that $$$\\sum n\\leq 5 \\times 10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print a single line containing an integer, denoting the number of possible arrays that can be $$$b$$$. As the answer can be very large, output it modulo $$$998244353$$$.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n4\n1 1 1 1\n4\n1 2 3 4\n4\n4 4 4 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n14\n35\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}