AtCoder Grand Contest 057
F
Reflection
AtCoder
⌀ 4128
原题
← E→
翻译中…

Problem Statement

翻译中…

There are three indistinguishable stones at integer coordinates on a number line. Consider the following operation on these stones:

翻译中…
  • Let $A, B, C$ be the three stones in ascending order of coordinate (ties broken arbitrarily). Perform one of the following.
  • Move $A$ to the symmetric position with respect to $B$.
    • Move $C$ to the symmetric position with respect to $B$.
翻译中…

You are given the initial coordinates $a, b, c$ of the three stones. Find the number, modulo $998244353$, of possible combinations of coordinates of the three stones after zero or more operations.

翻译中…

Note that the stones are indistinguishable. More strictly speaking, count the possible multisets of coordinates of the three stones.

翻译中…

We will give you $T$ test cases; solve each of them.

翻译中…

Constraints

翻译中…
  • $1\leq T\leq 10^5$
  • $-10^{18}\leq a\leq b\leq c\leq 10^{18}$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

T
\text{case}_1
\vdots
\text{case}_T

翻译中…

Each case is in the following format:

翻译中…

a b c

翻译中…

Output

翻译中…

Print $T$ lines. The $i$-th line should contain the answer for $\text{case}_i$.

翻译中…

样例

Input #1
6
1 3 5
-2 -2 5
0 1 3
31 41 59
-123456789 0 987654321
-1000000000000000000 0 1000000000000000000
Output #1
5
2
9
70
182333351
5
For $(a,b,c) = (1,3,5)$, the five possible combinations of the three stones after operations are: - $(1,3,5)$, $(1,1,3)$, $(-1,1,1)$, $(3,5,5)$, $(5,5,7)$. The figure below may be helpful. ![image](https://img.atcoder.jp/agc057/5fc6a5c57abe2c69d457111ddc3f6a51.png)
题目信息
题号
agc057_f
时间限制
3 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。