|
||||||||||
XorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 491 Accepted Submission(s): 235 Problem Description Given $A,B,K,W$, Kanade wants to know the number of $(x,y)$ which satisfies the following conditions: 1. $x,y$ are integers 2. $x\in [0,A],y\in [0,B]$ 3. $|x-y|\leq K$ 4. $x~xor~y\leq W$ Input There are $T$ test cases in this problem. The first line has 1 integer $T$. Then for every test case, the first line has 4 integers $A,B,K,W$ $1\leq T\leq 2000$ $0\leq A,B,K,W\leq 10^9$ Output For every test case, output the answer in a line. Sample Input
Sample Output
Source | ||||||||||
|