You are given an array $$$a$$$ of size $$$n$$$ and an integer $$$x$$$.
You need to perform $$$n$$$ operations. In the $$$i$$$-th operation, you must perform exactly one of the following operations:
Define the operation sequence $$$s$$$ as a string of length $$$n$$$, where $$$s_i \in \{$$$ 'G', 'L' $$$\}$$$ denotes the type of operation chosen in the $$$i$$$-th operation.
There is an additional constraint: You cannot use the G-operation twice in a row. Formally, if there exists an $$$i$$$ ($$$1 \le i \le n-1$$$) such that $$$s_i=s_{i+1}=\{$$$'G'$$$\}$$$, then it is illegal.
Find the minimum possible final value of $$$x$$$, assuming you perform the operations optimally. And count the number of different operation sequences that can achieve this minimum value, modulo $$$998,244,353$$$.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1\le t\le 2 \cdot 10^4$$$). The description of the test cases follows. For each test case:
The sum of $$$n$$$ across all test cases does not exceed $$$10^5$$$.
For each test case, print a single line containing two integers — the minimum possible final value of $$$x$$$, assuming you perform the operations optimally, and the number of different operation sequences that can achieve this minimum value, modulo $$$998,244,353$$$.
22 46 23 66 6 6
2 26 5
In the first test case:
We can see the minimum possible final value of $$$x$$$ is $$$2$$$, and the number of different operation sequences that can achieve this minimum value is $$$2$$$.