I. Ammar is back electricity is not
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Ammar returned home after escaping the DAG. But unfortunately, there was no electricity.

Ammar has $$$n$$$ bulbs in his house, each one has a button that changes the state of the bulb when pressed(it turns it on if it was off and vice versa). He remembers that at most $$$k$$$ of them were on when he left, but he doesn't remember which ones (yes, Mousa's spell is still working). Ammar wants to press some buttons so that he can make sure at least one bulb is on when the electricity is back; help him find the minimum number of buttons he has to press or tell him he can never make sure at least one bulb is on otherwise.

Input

The first line contains a single integer $$$tc \: (1 \leq tc \leq 100)$$$ — the number of testcases.

The only line of each testcase consists of two integers $$$n,k \: (1 \leq n \leq 2000) (0 \leq k \leq n)$$$ — the number of bulbs and the maximum number of bulbs that were on.

Output

For each testcase, print a single integer which is the minimum number of buttons he has to press or $$$-1$$$ if he can't make sure at least one bulb is on when the electricity is back.

Example
Input
2
1 0
9 4
Output
1
5