A, B = list(map(int, input().split()))



if A <= B * 2:

    print('0')

else:

    print((A - 2 * B))



A, B = list(map(int, input().split()))



print((max(0, A - 2 * B)))
A, B = list(map(int, input().split()))
if A <= B * 2:
    print("0")
else:
    print((A - 2 * B))

A, B = list(map(int, input().split()))
print((max(0, A - 2 * B)))

-if A <= B * 2: -    print("0") -else: -    print((A - 2 * B)) +print((max(0, A - 2 * B)))