409599: GYM103643 B Operations
Description
Bossologist is brushing up on his arithmetic skills, and has found an interesting way to practice by doing $$$P$$$ ($$$1 \leq P \leq 10^5$$$) problems of a certain format. For the $$$p$$$th problem, he first picks two numbers $$$A_p$$$ and $$$B_p$$$. He will then use the four operations $$$+, -, *, \div$$$ to combine $$$A_p$$$ and $$$B_p$$$ in any way (i.e. Bossologist finds $$$A_p+B_p$$$, $$$A_p-B_p$$$, $$$B_p+A_p$$$, etc.). For each of $$$P$$$ problems determine the number of distinct answers Bossologist gets.
InputThe first line of input will be $$$P$$$.
The next $$$P$$$ lines will each contain the two numbers $$$A_p$$$ and $$$B_p$$$ ($$$1 \leq A_p, B_p \leq 10^4$$$) he picks for the $$$p$$$th problem.
Note that test case $$$0$$$ is the sample case, which is not worth any points.
OutputOutput $$$P$$$ lines where the $$$p$$$th line gives the number of distinct answers Bossologist gets for problem $$$p$$$.
ExampleInput4 2 19 3 5 4 3 6 6Output
6 6 6 4Note
For the first problem, the possible answers are $$$2 + 19 = 21$$$, $$$2 - 19 = -17$$$, $$$19 - 2 = 17$$$, $$$19 \cdot 2 = 38$$$, $$$19 \div 2 = 9.5$$$, and $$$2 \div 19 \approx 0.105$$$, for a total of $$$6$$$ distinct answers.
$$$---------------------------------------------$$$
Problem Idea: Bossologist
Problem Preparation: Bossolgist
Occurrences: Novice 2