Wide Expression
시간 제한1초메모리 제한2048 MB
여섯 인덱스의 모든 범위에서 (ab + cd + 1)^(e XOR f)을 998244353으로 나눈 나머지를 구한다.
문제
Evil Arglwyddytywyllwch loves problems where something needs to be summed. Such problems usually have short statements and lack long legends about good and evil characters. He also doesn't like it when to solve a problem, you need to write a thousand numbers in the code. Therefore, he suggested the following problem to you.
Given non-negative integers , , , . Calculate
where is the operation of bitwise exclusive OR (that is, XOR).
입력
The first line contains a single integer (), denoting the number of test cases.
Each of the following lines contains four integers , , , (, , ), describing the test case.
It is guaranteed that the sum of the values for all test cases does not exceed .
출력
For each test case, print a single integer: the value of the sum modulo .