{"problem":{"name":"Reflection","description":{"content":"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 coordin","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc057_f"},"statements":[{"statement_type":"Markdown","content":"There are three indistinguishable stones at integer coordinates on a number line. Consider the following operation on these stones:\n\n*   Let $A, B, C$ be the three stones in ascending order of coordinate (ties broken arbitrarily). Perform one of the following.\n    *   Move $A$ to the symmetric position with respect to $B$.\n    *   Move $C$ to the symmetric position with respect to $B$.\n\nYou 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.\nNote that the stones are indistinguishable. More strictly speaking, count the possible **multisets** of coordinates of the three stones.\nWe will give you $T$ test cases; solve each of them.\n\n## Constraints\n\n*   $1\\leq T\\leq 10^5$\n*   $-10^{18}\\leq a\\leq b\\leq c\\leq 10^{18}$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\vdots$\n$\\text{case}_T$\n\nEach case is in the following format:\n\n$a$ $b$ $c$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc057_f","tags":[],"sample_group":[["6\n1 3 5\n-2 -2 5\n0 1 3\n31 41 59\n-123456789 0 987654321\n-1000000000000000000 0 1000000000000000000","5\n2\n9\n70\n182333351\n5\n\nFor $(a,b,c) = (1,3,5)$, the five possible combinations of the three stones after operations are:\n\n*   $(1,3,5)$, $(1,1,3)$, $(-1,1,1)$, $(3,5,5)$, $(5,5,7)$.\n\nThe figure below may be helpful.\n  \n\n![image](https://img.atcoder.jp/agc057/5fc6a5c57abe2c69d457111ddc3f6a51.png)"]],"created_at":"2026-03-03 11:01:14"}}