import numpy as np

import sys

a,b = list(map(int,input().split()))

c = b*2

print((a-c if a-c>=0 else 0))

a,b=list(map(int,input().split()))

print((max(0,a-2*b)))

import numpy as np
import sys

a, b = list(map(int, input().split()))
c = b * 2
print((a - c if a - c >= 0 else 0))

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

-import numpy as np -import sys - -c = b * 2 -print((a - c if a - c >= 0 else 0)) +print((max(0, a - 2 * b)))