We have a point $A$ with coordinate $x = n$ on $OX$-axis. We'd like to find an integer point $B$ (also on $OX$-axis), such that the absolute difference between the distance from $O$ to $B$ and the distance from $A$ to $B$ is equal to $k$. [Image] The description of the first test case. 

Since sometimes it's impossible to find such point $B$, we can, in one step, increase or decrease the coordinate of $A$ by $1$. What is the minimum number of steps we should do to make such point $B$ exist?


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 6000$) — the number of test cases.

The only line of each test case contains two integers $n$ and $k$ ($0 \le n, k \le 10^6$) — the initial position of point $A$ and desirable absolute difference.


-----Output-----

For each test case, print the minimum number of steps to make point $B$ exist.


-----Example-----
Input
6
4 0
5 8
0 1000000
0 0
1 0
1000000 1000000

Output
0
3
1000000
0
1
0



-----Note-----

In the first test case (picture above), if we set the coordinate of $B$ as $2$ then the absolute difference will be equal to $|(2 - 0) - (4 - 2)| = 0$ and we don't have to move $A$. So the answer is $0$.

In the second test case, we can increase the coordinate of $A$ by $3$ and set the coordinate of $B$ as $0$ or $8$. The absolute difference will be equal to $|8 - 0| = 8$, so the answer is $3$. [Image]

Difficulty: interview

Starter code:

Solutions:
for nt in range(int(input())):
	n,k = map(int,input().split())
	if k<n:
		if n%2==0:
			if k%2:
				print (1)
			else:
				print (0)
			continue
		else:
			if k%2:
				print (0)
			else:
				print (1)
			continue
	print (k-n)

for _ in range(int(input())):
    n, k = list(map(int, input().split()))
    if k > n:
        print(max(0, k-n))
    else:
        print((n-k)%2)


from math import ceil
from sys import stdin, stdout, setrecursionlimit
from random import randint

for _ in range(int(input())):
    n, k = list(map(int, input().split()))
    ans = 0
    if n < k:
        ans += k - n
        n = k
    if (n - k) % 2 == 1:
        ans += 1
    print(ans)



for _ in range(int(input())):
    n,k=list(map(int,input().split()))
    if n<k:
        print(k-n)
    else:
        if (n-k)%2==0:
            print(0)
        else:
            print(1)


import math


def main():
    n, k = list(map(int, input().split()))
    if k % 2 == n % 2:
        print(max(0, k - n))
    else:
        print(max(1, k - n))


def __starting_point():
    t = int(input())

    for i in range(t):
        main()
"""
60, 61
"""
"""
"""

__starting_point()

for _ in range(int(input())):
    n, k = list(map(int, input().split()))
    if n < k:
        print(k-n)
        continue
    for ans in range(2):
        a = n+ans
        if (a-k) % 2 == 0:
            print(ans)
            break


import sys
# sys.setrecursionlimit(10**6) 
input=sys.stdin.readline
t=int(input())
for t1 in range(t):
    n,k=list(map(int,input().split(" ")))
    if(n>=k):
        if((n+k)%2==0):
            print(0)
        else:
            print(1)
    else:
        print(k-n)


from queue import Queue

def rn():
    a = int(input())
    return a


def rl():
    a = list(map(int, input().split()))
    return a

for _ in range(rn()):
    [a,k] = rl()
    ans = 0
    if k<=a:
        if (k+a)%2 == 0:
            ans = 0
        else:
            ans = 1
    else:
        ans = (k-a)
        a = k
        if (k+a)%2 != 0:
            ans += 1
    print(ans)



for _ in range(int(input())):
    n, k = list(map(int, input().split()))
    if k > n:
        print(-n + k)
    else:
        if k % 2 != n % 2:
            print(1)
        else:
            print(0)


for _ in range(int(input())):
    n,k = list(map(int,input().split()))
    if k > n:
        print(k-n)
    else:
        if (n-k) % 2 != 0:
            print(1)
        else:
            print(0)


import math

t = int(input())

for p in range(t):
    n, k = map(int, input().split())
    if k > n:
        print(k - n)
    elif k%2 == n%2:
        print(0)
    else:
        print(1)

for _ in range(int(input())):
    n,k = list(map(int,input().split()))
    if n==k:
        print(0)
    elif n<k:
        print(k-n)
    else:
        if (n-k)%2==0:
            print(0)
        else:
            print(1)


t=int(input())
for you in range(t):
    l=input().split()
    n=int(l[0])
    k=int(l[1])
    if(n==k):
        print(0)
        continue
    if(k<n and k%2!=n%2):
        print(1)
        continue
    if(k<n):
        print(0)
        continue
    print(k-n)


for _ in range(int(input())):
    n, k = list(map(int, input().split()))
    if k >= n:
        print(k - n)
    else:
        if n % 2 != k % 2:
            print(1)
        else:
            print(0)


t = int(input())
for it in range(t):
    n, k = [int(i) for i in input().split()]
    if n >= k:
        print(0 if n % 2 == k % 2 else 1)
    else:
        print(k - n)


import math as mt
def tran(arr):
    if arr[1]>arr[0]:
        return arr[1]-arr[0]
    else:
        if arr[1]%2==0:
            if arr[0]%2==0:
                return 0
            else:
                return 1
        else:
            if arr[0]%2==1:
                return 0
            else:
                return 1

def __starting_point():
    t = int(input())
    ans = []
    for i in range(t):
        arr = list(map(int, input().rstrip().split()))
        r = tran(arr)
        ans.append(r)
    for i in ans:
        print(i)

__starting_point()

import sys
input = sys.stdin.readline
for f in range(int(input())):
    n,k=map(int,input().split())
    if k>=n:
        print(k-n)
    else:
        x=k-n
        if x%2==0:
            print(0)
        else:
            print(1)

for _ in range(int(input())):
    n,k=[int(c) for c in input().split()]
    if k >=n:
        print(k-n)
    else:
        if (n+k)&1:
            print(1)
        else:
            print(0)

t=int(input())
for i in range(t):
	n,k=map(int,input().split())
	if n<k:
		print(k-n)
	else:
		print((n+k)%2)

import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)


for _ in range(int(input())):
    n,k= map(int, input().split())
    if n>=k:
        print((n+k)%2)
    else:
        print(k-n)