409686: GYM103687 A JB Loves Math

Memory Limit:512 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. JB Loves Mathtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard output

JB is good at Math, so he thinks all the math problems in the world are easy.

But one day, he meets a math problem which he can't solve, so he asks you to help him.

JB will give you two numbers $$$a$$$ and $$$b$$$, and you should then choose a positive odd number $$$x$$$ and a positive even number $$$y$$$. You can let $$$a$$$ add $$$x$$$ or let $$$a$$$ minus $$$y$$$ in one operation. You should change $$$a$$$ into $$$b$$$ in the minimal number of operations. Note that you are not allowed to change the value of $$$x$$$ and $$$y$$$.

Input

In the first line, there is one integer $$$T$$$ ($$$1\leq T\leq 10^5$$$), denoting the number of test cases.

For each test case, there is one line containing two numbers $$$a$$$ and $$$b$$$ ($$$1\leq a,b\leq 10^6$$$), denotes the number given by JB.

Output

For each test case, print one number, denoting the minimal number of operations you need to change $$$a$$$ into $$$b$$$.

ExampleInput
2
3 6
5 3
Output
1
1

加入题单

算法标签: