The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)
We will close the window so as to minimize the total horizontal length of the uncovered part of the window.
Find the total horizontal length of the uncovered parts of the window then.

-----Constraints-----
 - 1 \leq A \leq 100
 - 1 \leq B \leq 100
 - A and B are integers.

-----Input-----
Input is given from Standard Input in the following format:
A B

-----Output-----
Print the total horizontal length of the uncovered parts of the window.

-----Sample Input-----
12 4

-----Sample Output-----
4

We have a window with a horizontal length of 12, and two curtains, each of length 4, that cover both ends of the window, for example. The uncovered part has a horizontal length of 4.

Difficulty: introductory

Starter code:

Solutions:
a,b=map(int,input().split())
if a > 2*b:
  print(a-2*b)
else:
  print("0")

a, b = map(int, input().split()) 
if a-b*2 <= 0:
  print(0)
else:
  print(a-b*2)

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

#143

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

ans = A - B*2

if ans <= 0:
    print((0))

else:
    print(ans)


a,b = [int(x) for x in input().split()]
print(max(0,a-2*b))

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

c=a-2*b
if c<0:
    c=0
print(c)

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

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

if a <= b:
    print(0)
elif a - 2*b <= 0:
    print(0)
elif a - 2*b > 0:
    print(a - 2 * b)

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

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

if A > 2*B:
    print(A-2*B)
else:
    print(0)

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

'''
if A > 2*B: print(A-2*B)
else: print(0)
'''

print(max(0, A-2*B))

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

if A > 2*B: print(A-2*B)
else: print(0)

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

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

print((max(0, A - 2 * B)))


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


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


a,b=map(int,input().split())
if b>=a:
    print('0')
elif a-2*b >= 0:
    print(a-2*b)
else:
    print('0')

a,b = map(int,input().split())
if(a-(2*b)<0):
  print(0)
else:
  print(a-(2*b))

a, b = map(int, input().split())
if a <= (b * 2):
    print(0)
else:
    print(a - (b * 2))

A, B = [int(n) for n in input().split()]

print(max(0, int(A-2*B)))

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

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

A, B = map(int,input().split())
L = int(A-2*B)
if L>0:
    print(L)
else:
    print(0)

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

if a <= 2*b:
  print("0")
else:
  print((a-2*b))

# 問題：https://atcoder.jp/contests/abc143/tasks/abc143_a

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



a,b=map(int,input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)

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

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

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


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


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

if a <= 2*b:
    print(0)
else :
    print(a-2*b)

a,b = map(int,input().split())
if a - 2 * b <= 0:
    print(0)
else:
    print(a - 2 * b)

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

a,b=map(int,input().split())
if(a-(2*b)<0):
  print(0)
else:
  print(a-(2*b))

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

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

result=a-b*2

if result > 0:
  print(result)
else:
  print(0)

#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(500000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


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


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


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


def main():
    solve()


def __starting_point():
    main()

__starting_point()

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

A,B=map(int,input().split())
if A>B*2:
  print(A-B*2)
else:
  print(0)

A, B = map(int, input().split())
ans = A - (2 * B)

if ans < 0:
    print(0)
else:
    print(ans)

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

A,B=map(int,input().split())
if A-(2*B)>=0:
    print(A-(2*B))
else:
    print(0)

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

A, B = map(int, input().split())
C = A - (B*2)
C = 0 if C < 0 else C
print(C)

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

print((max(0, A-2*B)))


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

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

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

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

if a <= b or a - (b * 2) <= 0:
    print("0")

else:
    print((a - (b * 2)))


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

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

a,b=map(int,input().split())
b*=2
if(a<=b):
    print(0)
else:
    print(a-b)

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

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

if A >= 2*B:
  print(A-2*B)
else:
  print(0)

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

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

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

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

A,B = (int(x) for x in input().split())
print(max(0,A-2*B))

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

if a>2*b:print(a-2*b)
else:print(0)

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

if A >= B*2: print(A-B*2)
else: print(0)

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

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

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

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

A, B = map(int, input().split())
if A > B * 2:
  print(A - 2 * B)
else:
  print(0)

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

A,B = map(int,input().split())
if(A >= B * 2):
    print(A - B * 2)
else:
    print(0)

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

if a > b * 2:
    print(a - b * 2)
else:
    print(0)

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

print(A - 2*B if 2*B <= A else 0)

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

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

if 2*B >= A:
    print(0)
else:
    print(A-2*B)

a,b=input().split()
a=int(a)
b=int(b)
if a-b*2>=0:
  print(int(a-b*2))
else:
  print("0")

a, b = [int(i) for i in input().split()]
if a >= b*2:
  print(a - b*2)
else:
  print(0)

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

print(A-B*2 if A-B*2>0 else 0)

a,b=map(int,input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)

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

if a > b * 2:
  print(a - b * 2)
else:
  print(0)

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

def resolve():
    a,b = map(int,input().split())
    print(0 if a<b*2 else a-b*2)
resolve()

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

ANS = A - B * 2
if ANS <= 0:
    print(0)
else:
    print(ANS)

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

a, b = list(map(int, input().split()))
res = a - b * 2

if res < 0:
    print((0))
else:
    print(res)


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


A, B = map(int, input().split())
print((A-2*B) if A > 2*B else 0)

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

if A - 2*B > 0 :
    print(A-2*B)
else :
    print("0")

a,b=map(int,input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)

a,b=list(map(int,input().split(' ')))
#count=0

if a<=(b*2):
    print((0))
else:
    print((a-(b*2)))


A, B = [int(n) for n in input().split()]
print(max(0, A-B*2))

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

house_len, curtain_len = map(int, input().split())

if house_len >= curtain_len * 2:
    print(house_len - curtain_len * 2)
else:
    print(0)

li = [int(x) for x in input().split()]
if 2*li[1]>=li[0]:
  print('0')
else:
  print((li[0]-2*li[1]))


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

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

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

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

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

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

a, b = [int(x) for x in input().split()]

b = b * 2

print(max(0, a - b))

a,b=map(int,input().split());print([0,a-2*b][a>=b*2])

A, B = map(int, input().split())
print(A-B*2) if A>B*2 else print(0)

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

print(max(0,A-B*2))