Geometry

아직 제출이 없습니다시간 제한3초메모리 제한1024 MB

문제

Grammy has a special two-dimensional coordinate system: the angle between the positive half-axis of the XX-axis and the positive half-axis of the YY-axis is 6060 degrees.

Consider the following graph. The vertices are all integer coordinates (x,y)(x,y) such that at least one of x,yx,y is odd and 2a+1x2a1-2a+1\leq x\leq 2a-1, 2b+1y2b1-2b+1\leq y\leq 2b-1, 2c+1x+y2c1-2c+1\leq x+y\leq 2c-1. The edges from (x,y)(x,y) go to (x,y+1)(x,y+1), (x,y1)(x,y-1), (x+1,y)(x+1,y), (x1,y)(x-1,y), (x+1,y1)(x+1,y-1), and (x1,y+1)(x-1,y+1).

Find the size of the maximum independent set of vertices in this graph. Additionally, find the number of such sets modulo 998,244,353998\\,244\\,353.

입력

The first line contains an integer TT (1T101 \leq T \leq 10), denoting the number of test cases.

Each of the following TT lines contains three integers aa, bb, cc (1a,b,c1061 \leq a, b, c \leq 10^6).

출력

Output TT lines. Each line must contain two integers: the size of the maximum independent set and the number of such sets. Please note that the size should not be taken modulo 998,244,353998\\,244\\,353.

힌트

The following picture shows the situation for the first and second test case of the sample.

Point JJ has coordinates (2,1)(2, 1), point FF has coordinates (1,0)(-1, 0), and point HH has coordinates (2,0)(2, 0). Among these three points, only HH has even XX-coordinate and even YY-coordinate. The neighbours of point AA are BCDEFG\mathit{B C D E F G}.

In the first test case, the points that satisfy the conditions are NGBIJPFCKMLEDST\mathit{N G B I J P F C K M L E D S T}.

The size of the maximum independent set is 77, and there are 44 ways: PNLBDJT\mathit{P N L B D J T}, RMFBDJT\mathit{R M F B D J T}, RMGECJT\mathit{R M G E C J T}, RMGEISK\mathit{R M G E I S K}.

In the second test case, the points that satisfy the conditions are GBIFCLED\mathit{G B I F C L E D}.

The size of the maximum independent set is 44, and there is one way: LGID\mathit{L G I D}.