Codeforces Round 964 (Div. 4) |
---|
Finished |
Suneet and Slavic play a card game. The rules of the game are as follows:
Since Suneet and Slavic aren't best friends, you need to calculate the number of ways the game could happen that Suneet would end up as the winner.
For a better understanding, please check the notes section.
The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases.
The first and only line of each test case contains $$$4$$$ integers $$$a_1$$$, $$$a_2$$$, $$$b_1$$$, $$$b_2$$$ ($$$1 \leq a_1, a_2, b_1, b_2 \leq 10$$$) where $$$a_1$$$ and $$$a_2$$$ represent the cards Suneet has, and $$$b_1$$$ and $$$b_2$$$ represent the cards Slavic has, respectively.
For each test case, output a single integer — the number of games Suneet would win considering all possible games.
53 8 2 61 1 1 110 10 2 21 1 10 103 8 7 2
2 0 4 0 2
Consider the first test case when Slavic starts with the cards that have the values $$$2$$$ and $$$6$$$, and Suneet starts with cards that have the values $$$3$$$ and $$$8$$$. The game could happen in $$$4$$$ different ways:
Name |
---|