Pair
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

Given three integers , , . Count the number of pairs <> (with and )
such that at least one of the following is true:
- () >
- () <

("and", "xor" are bit operators)

输入描述:

The first line of the input gives the number of test cases, .  test cases follow.

For each test case, the only line contains three integers , and .

输出描述:

For each test case, the only line contains an integer that is the number of pairs satisfying the condition given in the problem statement.
示例1

输入

复制
3
3 4 2
4 5 2
7 8 5

输出

复制
5
7
31