#d2919. a 变为 b

a 变为 b

Changing a to b

Problem Description

You are given two integers aa and bb. You first choose a positive odd number xx and a positive even number yy (these remain fixed throughout the whole process). In each step you may choose one of the following:

  • Let a←a+xa \leftarrow a + x;
  • Let a←a−ya \leftarrow a - y.

Find the minimum number of operations needed to turn aa into bb.

Input Format

The first line contains an integer TT.

Each of the next TT lines contains two integers a,ba, b.

Output Format

For each test case, output one line containing one integer — the minimum number of operations.

Sample Input

1
10 7

Sample Output

2

Constraints

  • 1≤T≤1051 \le T \le 10^5
  • 1≤a,b≤1061 \le a, b \le 10^6