Problem:
 Score : 200 points    Problem Statement AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W .
If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W] , and the second rectangle covers the vertical range of [1,2] and the horizontal range of [b,b+W] , as shown in the following figure:   AtCoDeer will move the second rectangle horizontally so that it connects with the first rectangle.
Find the minimum distance it needs to be moved.      Constraints  All input values are integers.  1≤W≤10^5  1≤a,b≤10^5         Input The input is given from Standard Input in the following format:  W  a  b       Output Print the minimum distance the second rectangle needs to be moved.        Sample Input 1 3 2 6      Sample Output 1 1  This input corresponds to the figure in the statement. In this case, the second rectangle should be moved to the left by a distance of 1 .       Sample Input 2 3 1 3      Sample Output 2 0  The rectangles are already connected, and thus no move is needed.       Sample Input 3 5 10 1      Sample Output 3 4

Solution (Python):
import math
import sys

def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

w = int(arr_data[0][0])
a = int(arr_data[0][1])
b = int(arr_data[0][2])






if abs(b-a)-w<=0 :
    
    print(0)

elif abs(b-a)-w>0:
    
    print(abs(b-a)-w)

Solution (Python):
W,a,b=map(int,input().split())
ans=max(a,b)-(min(a,b)+W)
print(max(ans,0))

Solution (Python):
w, a, b = map(int,input().split())
print(0 if (a<=b and b<=a+w) or (b<=a and a<=b+w)  else abs((a+w)-b) if a<b else abs((b+w)-a))

Solution (Python):
W, a, b = map(int, input().split())

dis_a = b - (a+W)
dis_b = a - (b+W)

if dis_a <= 0 and dis_b <= 0:
    print(0)
elif dis_a > dis_b:
    print(dis_a)
else:
    print(dis_b)

Solution (Python):





if __name__ == '__main__':
    width, a, b = list(map(int, input().split()))

    if (a + width) < b:
        print(min(b - (a + width), b - a))
    elif a <= b <= (a + width):
        print(0)
    else:
        print(min(a - b, a - (b + width)))

Solution (Python):
w, a, b = map(int, input().split())
if a > b: print(max(0, a - (b + w)))
else: print(max(0, b - (a + w)))

Solution (Python):
w, a, b = map(int, input().split())
if b >= a and b <= (a + w):
    print(0)
else:
    print(min(abs(b - a - w), abs(a - b - w)))

Solution (Python):
w,a,b = (int(i) for i in input().split())
if a<=b<=a+w or a<=b+w<=a+w: print(0)
elif b+w<a: print(a-(b+w))
else: print(b-(a+w))

Solution (Python):
W, a, b = map(int, input().split())
if a<=b<=a+W or a<=b+W<=a+W:
    print(0)
else:
    print(min([abs(b-a-W),abs(a-b-W)]))

Solution (Python):
W, a, b = list(map(int, input().split()))

big = max(a, b)
small = min(a, b)

diff = big - (small + W)
if diff < 0:
    print(0)
else:
    print(diff)

Solution (Python):
W, a, b = map(int, input().split())
r = min(a,b)
l = max(a,b)
print(0 if (r+W)>=l else l-(r+W))

Solution (Python):
w, a, b  = map(int, input().split())
if a + w < b:
    print(b - a - w)
elif b + w < a:
    print(a - b - w)
else:
    print('0')

Solution (Python):
w,a,b=map(int,input().split())
if a+w>=b and b+w>=a:
    print(0)
elif a+w>b:
    print(a-b-w)
else:
    print(b-a-w)

Solution (Python):
import sys
W,a,b=map(int,input().split())
if(a<b):
    move=b-a-W
else:
    move=a-b-W
if(move<=0):
    print(0)
else:
    print(move)

Solution (Python):
W, a, b = [int(i) for i in input().split()]
if 2 * W >= max(a + W, b + W) - min(a, b):
    print('0')
else:
    print(abs(min(a + W, b + W) - max(a, b)))

Solution (Python):
w,a,b=map(int, input().split())

m=max(a,b)
s=min(a,b)

if m<=s+w:
    print(0)
else:
    print(abs(m-(s+w)))

Solution (Python):
w,a,b = map(int,input().split())
ans = []
ans.append(b-(a+w))
ans.append(a-(b+w))
if max(ans) < 0:
    print("0")
else:
    print(max(ans))

Solution (Python):
w,a,b=[int(i) for i in input().split()]
if a > b:
	a, b = b, a
print(max(0, b - (a + w)))

Solution (Python):
w,a,b=map(int,input().split())
if a<b:
    if a+w>b:
        print(0)

    else:
        print(b-a-w)

else:
    if b+w>a:
        print(0)
    else:
        print(a-b-w)

Solution (Python):
W,a,b=map(int, raw_input().split())
x1=min(a,b)
x2=max(a,b)
print x2-(x1+W) if x2>x1+W else 0

Solution (Python):
w, a, b = map(int, input().split())
if b >=  a+w:
   print(b-a-w)
elif b+w<= a:
   print(a-b-w)
else:
   print(0)

Solution (Python):
w, a, b = [int(x) for x in input().split()]
if a + w < b:
    print(b - a - w)
elif b + w < a:
    print(a - b - w)
else:
    print(0)

Solution (Python):
w, a, b = map(int, input().split())
print(max(0, max(a, b) - (min(a, b) + w)))

Solution (Python):

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

if a > b:
    a, b = b, a

k = max(0, b - (a + w))


print(k)

Solution (Python):
w,a,b=map(int,input().split())
if a<=b<=a+w:
    print(0)
elif a<=b+w<=a+w:
    print(0)
else:
    print(max(b-(a+w),a-(b+w)))

Solution (Python):
w,a,b=map(int,input().split())
if a+w<b:
    print(b-(a+w))
elif b+w<a:
    print(a-(b+w))
else:
    print(0)

Solution (Python):
def main():
    """
    連結: ずれて重なっていてもよい
    """
    W, a, b = map(int, input().split())

    
    
    ans = 0
    if b - (a + W) >= 0:
        
        ans = b - (a + W)
    elif a - (b + W) >= 0:
        
        ans = a - (b + W)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
w,a,b=map(int,input().split())
print(max(0,abs(a-b)-w))

Solution (Python):

if __name__ == '__main__':

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

    if (a + w - b) * (a - (b + w)) <= 0:
        print(0)
    elif b > a + w:
        print(b - a - w)
    else:
        print(a - b- w)

Solution (Python):
W, a, b = map(int,input().split())
ans = 0
if b > a + W:
    ans = b - (a + W)
elif a > b + W:
    ans = a - (b + W)
print(ans)

Solution (Python):
W,a,b = map(int,input().split())

min1 = W + a
min2 = W + b
if b > a:
	if b - min1 > 0 :
		print(b-min1)
	else:
		print(0)
if a > b:
	if a - min2 > 0 :
		print(a-min2)
	else:
		print(0)
if a == b:
	print(0)

Solution (Python):
w, a, b = map(int, input().split())

if b > a + w:
  print(b - (a + w))
elif b + w < a:
  print(a - (b + w))
else:
  print(0)

Solution (Python):
val = [int(x) for x in input().split()]

if val[1] <= val[2]:
    print(val[2]-(val[1]+val[0]) if val[2]-(val[1]+val[0]) > 0 else 0)
else:
    print(val[1]-(val[2]+val[0]) if val[1]-(val[2]+val[0]) > 0 else 0)

Solution (Python):
w, a, b = list(map(int, input().split()))
if(abs(a - b) <= w):
    print(0)
elif((a + w) < b):
    print(b - a - w)
elif((b + w) < a):
    print(a - b - w)

Solution (Python):
def solve():
    W, a, b = list(map(int, input().split(" ")))

    if a < b:
        if b - (a + W) > 0:
            print(b - (a + W))
        else:
            print(0)
    elif b < a:
        if a - (b + W) > 0:
            print(a - (b + W))
        else:
            print(0)
    else:
        print(0)


solve()

Solution (Python):
W, a, b = [int(n) for n in input().split()]
res = max(b-(a+W), a-(b+W), 0)

print(res)

Solution (Python):
inp = input().split()
w = int(inp[0])
a = int(inp[1])
b = int(inp[2])

print(max(max(a-b-w,b-a-w),0))

Solution (Python):
w, a, b = map(int, input().split())
print(max(abs(a-b)-w, 0))

Solution (Python):
W, a, b = map(int, input().split())
if b + W < a:
    print(a - b - W)
elif a + W < b:
    print(b - a - W)
else:
    print(0)

Solution (Python):
w, a, b = [int(i) for i in input().split()]
if a < b:
    print(max(b - (a + w), 0))
else:
    print(max(a - (b + w), 0))

Solution (Python):
W, a, b = map(int, input().split())

def f(w, a, b):
    if b <= a+W:
        return 0
    else:
        return b - (a+W)

print(f(W, a, b) if a <= b else f(W, b, a))

Solution (Python):
W, a, b = list(map(int, input().split()))
if a > b:
    a, b = b, a
print(max(0, b-a-W))

Solution (Python):
w, a, b = map(int, input().split())
if a < b:
    if a + w > b:
        print("0")
    else:
        print(b - a - w)
else:
    if b + w > a:
        print("0")
    else:
        print(a - b - w)

Solution (Python):
w,a,b = map(int,input().split())
tmp = max(a,b)
a = min(a,b)
b =tmp
print(max(b-(a+w),0))

Solution (Python):
def main():
    w, a, b = map(int, input().split())
    if a+w < b:
        print(b-a-w)
    elif b+w < a:
        print(a-b-w)
    else:
        print(0)


if __name__ == "__main__":
    main()

Solution (Python):
w,a,b=[int(x) for x in input().split()]
print(max(0,b-a-w,a-b-w))

Solution (Python):
W, a, b = map(int,input().split())

ans=abs(b-(a+W))


if abs(a-b)<=W:
    print("0")
else:
    print(abs(a-b)-W)

Solution (Python):
W, a, b = map(int, input().split())

if a + W < b:
    print(b - a - W)
elif b + W < a:
    print(a - b - W)
else:
    print(0)

Solution (Python):
W,A,B = map(int,input().split())
if W+A>=B:
	if B+W<=A:
		print(A-W-B)
	else:
		print(0)
else:
	print(B-A-W)

Solution (Python):



import sys
import re
import math
import collections
import itertools
import functools

DEBUG = True
DEBUG = False

def dbg(*args):
    if DEBUG:
        print("DBG: ", file=sys.stderr, end="")
        print(*args, file=sys.stderr)



def main():
    W, a, b = map(int, input().split())

    if b+W >= a and b <= a+W:
        print(0)
    elif b+W < a:
        print(a-(b+W))
    elif b > a+W:
        print(b-(a+W))

if __name__ == "__main__": main()

Solution (Python):
w, a, b = map(int, input().split())

if b <= a+w and a+w <= b+w:
    print(0)
elif b <= a and a <= b+w:
    print(0)
else:
    if a+w < b:
        ans = b - (a + w)
        print(ans)
    elif a > b+w:
        ans = a - (b + w)
        print(ans)

Solution (Python):
w, a, b = map(int, input().split())
if a > b:
    a, b = b, a
ans = max(0, b-(a+w))
print(ans)

Solution (Python):
from collections import defaultdict


def main():
    W, a, b = map(int, input().split())
    i, j, k, l = a, a + W, b, b + W
    if (i <= k <= j) or (i <= l <= j) or (k <= i <= l) or (k <= j <= l):
        print(0)
    else:
        print(min([abs(k - i), abs(k - j), abs(l - i), abs(l - j)]))


if __name__ == '__main__':
    main()

Solution (Python):
W,a,b=map(int,input().split())
if (b-a-W>0):
 print (b-a-W)
elif (a-b-W>0):
 print(a-b-W)
else:
 print (0)

Solution (Python):
W, a, b = list(map(int, input().split(" ")))

if ((b - (a+W)) > 0):
    print((b - (a+W)))
elif ((a - (b+W)) > 0):
    print((a - (b+W)))
else:
    print(0)

Solution (Python):
w,a,b = map(int,input().split())
ans = b - (a + w)
if a<= b and b <= a + w:
    print("0")
elif ans >= 0:
    print(ans)
else:
    ans = a - (b + w)
    print(ans)

Solution (Python):
W, a, b = list(map(int, input().split()))

if(a < b):
    d = b - (a + W)
    if(d <= 0):
        print("0")
    else:
        print(d)
elif(a > b):
    d = a - (b + W)
    if(d <= 0):
        print("0")
    else:
        print(d)

elif(a == b):
    print("0")

Solution (Python):


import sys
import subprocess
import json
import time
import math
import re
import sqlite3

W, a, b = map(int, input().split())
if a > b: a, b = b, a
print(max(0, b - (a + W)))

Solution (Python):
w, a, b = map(int, input().split())
res = abs(a - b) - w
if res < 0:
    res = 0
print(res)

Solution (Python):
w,a,b = map(int, input().split())
print(b-(a+w) if b>a+w else a-(b+w) if a>b+w else 0 )

Solution (Python):
MOD=1000000007

def solve():
    W,a,b=map(int,input().split())
    if a+W<b:
        print(b-a-W)
    elif b+W<a:
        print(a-b-W)
    else:
        print(0)

if __name__ == "__main__":
    solve()

Solution (Python):
def solve():
  ar = raw_input().split(' ')
  W = int(ar[0])
  a = int(ar[1])
  b = int(ar[2])
  if a+W < b : return b-a-W
  if b+W < a : return a-b-W
  return 0

if __name__ == '__main__' :
  print solve()

Solution (Python):
W, a, b = map(int, input().split())
if (b > (a+W)):
    print(b - (a+W))
elif (a <= b <= (a+W)):
    print(0)
else:
    print(a - (b+W))

Solution (Python):
if __name__ == "__main__":
    W,a,b = map(int, input().split())
    if a > b:
        a,b = b,a
    res = max((b - (a + W), 0))
    print (res)

Solution (Python):
w, a, b = map(int, input().split())

if a+w < b:
    ans = (-(a+w-b))
elif b+w < a:
    ans = a-b-w
else:
    ans = 0
print (ans)

Solution (Python):
n = input()
tmp_n = n.split(" ")

W = tmp_n[0]
a = tmp_n[1]
b = tmp_n[2]

aW = int(W)+int(a)
bW = int(W)+int(b)

if a<b:
    if int(b)-aW<0:
        print("0")
    else:
        print(int(b)-aW)  
else:
    if int(a)-bW<0:
        print("0")
    else:
        print(int(a)-bW)

Solution (Python):
w, a,b=map(int, input().split())
print(max(b-a-w,a-b-w,0))

Solution (Python):
W, a, b = map(int, raw_input().split())
if (a+W-b) * (a-b-W) < 0:
    print 0
else:
    print min(abs(b-a-W), abs(b-a), abs(b+W-a), abs(b-a))

Solution (Python):
W, a, b = map(int, input().split())
if b >= a + W:
    print(b - (a + W))
elif b + W <= a:
    print(a - (b + W))
else:
    print(0)

Solution (Python):
w, a, b = map(int, input().split())

print( max(0, abs(b-a) - w))

Solution (Python):
W, a, b = map(int, input().split())

abs = max(a, b) - min(a, b) - W

print(max(0, abs))

Solution (Python):
W, a, b = map(int, raw_input().split())
if a < b:
    print max(b - (a + W), 0)
elif a > b:
    print max(a - (b + W), 0)
else:
    print 0

Solution (Python):
import sys

W, a, b = (int(i) for i in input().split(" "))

if a <= b  <= a + W or a <= b + W <= a + W:
	print("0")
elif a + W < b:
	c = b - (a + W)
	print(c)
elif b + W < a:
	c = a - (b + W)
	print(c)

Solution (Python):
w,a,b=(int(i)for i in input().split())
if abs(a-b)>w:
    print(min(abs(a+w-b),abs(a-w-b)))
else:
    print(0)

Solution (Python):
w, a, b = map(int, input().split())
a1 = a+w
b1 = b+w
ans = 0

if a1<b:
    ans = b-a1
elif b1<a:
    ans = a-b1
print(ans)

Solution (Python):


import sys
import os


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

if a <= b:
    if a + W <= b:
        diff = b - (a + W)
        print(diff)
    else:
        print(0)
else:
    if b + W <= a:
        diff = a - (b + W)
        print(diff)
    else:
        print(0)

Solution (Python):
W, a, b = [int(x) for x in input().split()]

if abs(b - a) - W > 0:
	ans = abs(b - a) - W
else:
	ans = 0

print(ans)

Solution (Python):
W,a,b = map(int, input().split())
print(max(abs(a - b) - W, 0))

Solution (Python):
W,a,b = map(int, input().split())
c = (b - (a + W)) if a < b else (a - (b + W))
print(0) if c < 0 else print(c)

Solution (Python):
W, a, b =map(int,input().split())

if a<=b<=(a+W) or a<=(b+W)<=(a+W):
    print(0)

elif (a+W)<=b:
        print(b-(a+W)) 

else:
    print(a-(b+W))

Solution (Python):

w,a,b = list(map(int,input().split(" ")))
if (a-w) <= b <= (a+w):
	print(0)
else:
	print(abs(b-a)-w)

Solution (Python):
W, a, b = [int(i) for i in input().split()]

if a > b:
    a, b = b, a

if b-(a+W) <= 0:
    print(0)
else:
    print(b-(a+W))

Solution (Python):
w,a,b=map(int,raw_input().split())
if a+w<=b:
    print b-(a+w)
elif b+w<=a:
    print a-(b+w)
else:
    print 0

Solution (Python):
import sys

def solve(w, a, b):
    ans = 0

    if w + b < a:
        ans = a - (b + w)
    elif (a <= b + w) and (b <= a + w):
        ans = 0
    else:
        return b - (a + w)
    return ans

def main():
    line = sys.stdin.readline()
    w, a, b = [ int(s) for s in line.split()]

    ans = solve(w, a, b)
    print(ans)
    return 0

if __name__ == '__main__':
    sys.exit(main())

Solution (Python):
w, a, b = map(int, input() .split())

if a + w < b:
    print(b - (a + w))
elif b + w < a:
    print(a - (b + w))
else:
    print(0)

Solution (Python):
W, a, b = map(int, input().split())
if a+W < b:
    print(abs(a+W-b))

elif b+W < a:
    print(abs(b+W-a))

elif a <= b <= a+W or b <= a <= b+W :
    print(0)

Solution (Python):

W, a, b = map(int, raw_input().split())
print 0 if a <= b <= a + W or a <= b + W <= a + W else min(abs(b - (a + W)), abs(a - (b + W)))

Solution (Python):
[W,a,b] = map(int, raw_input().split())
if ((a <= b) and (b <= a+W)) or ((a <= b+W) and (b+W <= a+W)):
    print 0
else:
    print min(abs(b-(a+W)), abs(a-(b+W)))

Solution (Python):
W, a, b = map(int, raw_input().strip().split(" "))

if(a+W < b):
    print b - (a+W)
elif(b+W < a):
    print a - (b+W)
else:
    print 0

Solution (Python):
w,a,b = map(int, raw_input().split())

if a+w < b:
    print b-(a+w)
elif b+w < a:
    print a-(b+w)
else:
    print 0

Solution (Python):
W,a,b = map(int,input().split())
if abs(a-b) > W:
     print(abs(a-b)-W)
else:
     print(0)

Solution (Python):
W,a,b =  [int(item) for item in input().split()]
print(max(0, abs(b - a) - W))

Solution (Python):


W, a, c= map(int,raw_input().split())

b = a + W
d = c + W

if b < c:
    ans = c - b
elif d < a:
    ans = a - d
else:
    ans = 0
    
print(ans)

Solution (Python):
import numpy as np

W,a,b = map(int,raw_input().split())

if np.abs(a-b) < W:
    print 0
else:
    print np.abs(a-b)-W

Solution (Python):
if __name__ == "__main__":
    inp = [int(i) for i in input().split()]
    W = inp[0]
    a = inp[1]
    b = inp[2]
    print(max(0, b-(a+W), a-(b+W)))

Solution (Python):
W, a, b = map(int, input().split())
if abs(a-b) > W:
    print(min(abs(a - b), abs(a - b + W), abs(b - a + W)))
else:
    print(0)

Solution (Python):
arg = list(map(int, input().split(' ')))
W = arg[0]
a = arg[1]
b = arg[2]

if a>b:
    tmp = a
    a = b
    b = tmp

res = b - (a+W)
if res<0:
    res = 0
    
print(res)

Solution (Python):
lst = input().split(" ")
W =int(lst[0])
a =int(lst[1])
b =int(lst[2])
if b > a+W:
	print(b-(a+W))
elif b+W <a :
	print(a-(b+W))	
else :
	print(0)

Solution (Python):
W, a, b = map(int, input().split())
if b < a: a, b = b, a
print(max(0, (b - a - W)))

Solution (Python):
arg = input().split(' ')
w = int(arg[0])
a = int(arg[1])
b = int(arg[2])

res = 0

if a <= b <= a + w or a <= b + w <= a + w:
  res = 0
else:
  res = min(abs(b - (a + w)), abs(a - (b + w)))

print(res)

Solution (Python):

W, a, b = map(int, input().split())
if a+W < b:
    print("%d" % (b-a-W))
elif b+W < a:
    print("%d" % (a-b-W))
else:
    print("0")

Solution (Python):



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

if a + w < b:
    print(b - (a + w))
elif b + w < a:
    print(a - (b + w))
else:
    print(0)

Solution (Python):



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

if (a + w >= b and b >= a) or (b + w >= a and b <= a):
    print(0)
elif a + w < b:
    print(b - (a + w))
else:
    print(a - (b + w))

Solution (Python):
def main():
    W, a, b = map(int, input().split())
    if a + W < b:
        print(b - a - W)
    elif b + W < a:
        print(a - b - W)
    else:
        print(0)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict


def main():
    W, a, b = map(int, input().split())
    if a <= b <= a + W or a <= b + W <= a + W:
        print(0)
    else:
        print(min(abs(b - (a + W)), abs(a - (b + W))))


if __name__ == '__main__':
    main()

Solution (Python):
w, a, b = map(int, input().split())

if b < a:
    a, b = b, a

ans = max(b - (a + w), 0)

print(ans)

Solution (Python):
w,a,b=[int(x) for x in input().split()]

if b>a+w:
    print(b-(a+w))
elif b+w<a:
    print(a-(b+w))
else:
    print(0)

Solution (Python):


wab = [int(i) for i in input().split()]

w = wab[0]
a = wab[1]
b = wab[2]

if (a <= b+w) and (b <= a+w):
    print(0)
else:
    if a < b:
        print(abs(a-b+w))
    elif b < a:
        print(abs(a-b-w))
    else:
        print(w)

Solution (Python):
W,a,b = [int(x) for x in raw_input().split(" ")]

if (a <=b <= a + W) or (b<=a <= b+W):
	print 0
	
elif a+W < b:
	print b - (a+W)
	
else:
	print a - (b+W)

Solution (Python):
import sys, array, math, re, functools
input = lambda: sys.stdin.readline()
@functools.lru_cache(maxsize = 10000)

def Main():
  W, a, b = map(int ,input().split())
  A = a + W
  B = b + W
  if b <= A <= b+W:
    print(0)
  elif a <= B <= a+W:
    print(0)
  elif A < b:
    print(b - A)
  elif B < a:
    print(a - B)
  elif A > b:
    print(abs(a - b))
  elif B > a:
    print(abs(b - a))
    
if __name__ == '__main__':
  Main()

Solution (Python):
w, a, b = map(int, input().split())

if a <= b <= (a + w) or a <= (b + w) <= (a + w):
    print(0)
elif (a + w) < b:
    print(b - (a + w))
elif a > (b + w):
    print(a - (b + w))

Solution (Python):
def calc(w, a, b):
	a_max = a + w
	b_max = b + w
	
	if b > a_max:
		return b - a_max
	elif a > b_max:
		return a - b_max
	else:
		return 0

inpt = raw_input().split()

w = int(inpt[0])
a = int(inpt[1])
b = int(inpt[2])

print calc(w, a, b)

Solution (Python):
w, a, b =map(int, raw_input().split())
if a > b:
    a, b = b, a

print max(0, b-a-w)

Solution (Python):
w,a,b=map(int,input().split())
if abs(a-b)<=w:
    print(0)
else:
    print(abs(a-b)-w)

Solution (Python):
W, a, b = list(map(int, input().split()))
if a > b:
    ren = a - (b + W)
elif a < b:
    ren = b - (a + W)
else: ren = 0

print(0 if ren < 0 else ren)

Solution (Python):
w, a, b = input().split()
w2 = int(w)
a2 = int(a)
b2 = int(b)

if a2+w2 <= b2:
    print(b2-a2-w2)
elif a2 <= b2 < a2+w2:
    print(0)
else:
    print(a2-b2-w2)

Solution (Python):
W, a, b = map(int,input().split())
if a+W <= b:
    print(b-(a+W))
elif b+W <= a:
    print(a-(b+W))
else:
    print(0)

Solution (Python):
w, a, b = map(int, input().split())
d = abs(a - b)
print(d - w if d > w else 0)

Solution (Python):
W,a,b  = map(int,input().split())
aW = a + W
bW = b + W

if b >= aW:
    print(b-aW)
elif a >= bW:
    print(a - bW) 
else:
    print(0)

Solution (Python):
w,a,b=map(int,input().split())
print(0 if a<=b+w and b<=a+w else min(abs(a+w-b),abs(a-w-b)))

Solution (Python):
W, a, b = [int(i) for i in input().split()]

print(max(max(a,b) - min(a,b) - W, 0))

Solution (Python):
w,a,b=map(int,raw_input().split())
if b+w<a:
    print a-(b+w)
elif a+w<b:
    print b-(a+w)
else:
    print 0

Solution (Python):
w,a,b, = map(int,input().split())

ans = 0
if a+w < b:
    ans = b-(a+w)
elif b+w < a:
    ans = a-(b+w)
print(ans)

Solution (Python):


def main():
    W, a, b = map(int, raw_input().split())
    a_end = a+W
    b_end = b+W
    if (b <= a_end and b >= a) or (a<=b_end and a >= b):
        print 0
        return 0
    dist = b - a_end
    if dist < 0:
        dist = a - b_end
    print dist

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    W,a,b = map(int,input().split())
    L1, R1 = a,a+W
    L2, R2 = b,b+W
    if not( R2 < L1 or R1 < L2 ):
        print(0)
    elif R2 < L1:
        print(L1-R2)
    else:
        print(L2-R1)

if __name__ == "__main__":
    main()

Solution (Python):
def main():
    x = input().split()

    W = int(x[0])
    a = int(x[1])
    b = int(x[2])

    if b > a+W:
        print(b - (a+W))
        return
    elif a > b+W:
        print(a - (b+W))
        return

    print(0)

if __name__ == '__main__':
    main()

Solution (Python):
l=map(int, raw_input().split(" "))

import math

w=l[0]
a2b=abs(l[1]-l[2])

if a2b<w:
    print 0
else:
    print a2b-w

Solution (Python):
str = input().rstrip().split(" ")
W = int(str[0])
a = int(str[1])
b = int(str[2])
x = 0

if a < b:
        x = b - (a + W)
elif a > b:
        x = a - (b + W)

if a == b or x < 0:
        print("0")
else:
        print(x)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()



def main():
    w,a,b = LI()
    if b < a:
        a,b = b,a
    return max(b-a-w,0)

print(main())

Solution (Python):
W, a, b = map(int,input().split())

if b+W<a:
    an = a-b-W
elif b+W>=a and b<=a+W:
    an = 0
elif b>a+W:
    an = b-a-W

print(an)

Solution (Python):
import math
w, a, b = map(int, input().split())
if a+w < b:
    print(int(math.fabs(b-a-w)))
elif b+w < a:
    print(int(math.fabs(b+w-a)))
else:
    print(int(0))

Solution (Python):
import math
w, a, b = [int(i) for i in input().split()]
if a+w < b:
    print(int(math.fabs(b-a-w)))
elif b+w < a:
    print(int(math.fabs(b+w-a)))
else:
    print(int(0))

Solution (Python):


w,a,b=map(int,raw_input().split())
if abs(b-a)<=w:
 print 0
else:
 print abs(b-a)-w

Solution (Python):
w , a , b = map(int,raw_input().split())

if a < b:
    if (a+w) >= b:
        print 0
    else:
        print abs(b - (a+w))
if b < a:
    if (b+w) >= a:
        print 0
    else:
        print abs(a - (b+w))
if a == b:
    print 0

Solution (Python):
W, a, b = map(int, raw_input().split())
print max(abs(a-b)-W, 0)

Solution (Python):
w,a,b=map(int,input().split())
print(max(0, a-b-w if a > b else b-a-w))

Solution (Python):
w,a,b=map(int,input().split())
print(max(max(a,b)-min(a,b)-w,0))

Solution (Python):
w, a, b = map(int, input().split())
if a <= b <= a + w:
    print(0)
else:
    print(min(abs(a - (b + w)), abs(b - (a + w))))

Solution (Python):
W, a, b = list(map(int, input().split()))
if a > b: a, b = b, a
ans = max(0, b-(a+W))
print(ans)

Solution (Python):
W, a, b = map(int, raw_input().split())

if a > b:
    a, b = b, a
print max(b - a - W, 0)

Solution (Python):
w, a, b = map(int, input().split())
d = abs(a-b)-w
print(max(d,0))

Solution (Python):
w, a, b = map(int, input().split())
d = abs(a-b)-w
print(max(d,0))

Solution (Python):
W, a, b = map(int,input().split())
if a<b:
    if a+W>=b:
        print(0)
    else:
        print(b-(a+W))
else:
    if b+W>=a:
        print(0)
    else:
        print(a-(b+W))

Solution (Python):
W, a, b = map(int, raw_input().split())

if a < b:
    print max(0, b - (a + W))
else:
    print max(0, a - (b + W))

Solution (Python):
i = map(int, raw_input().split(" "))
l = abs(i[1] - i[2]) - i[0]
print( l if (l > 0) else 0)

Solution (Python):
w, a, b = input().split()
w = int(w)
a = int(a)
b = int(b)

if a < b:
    res = b - (a + w)
else:
    res = a - (b + w)

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

Solution (Python):
w, a, b = map(int, input().split())
if b+w < a:
    print(-b-w+a)
elif b > a+w:
    print(b-w-a)
else:
    print(0)

Solution (Python):

W,a,b = map(int, raw_input().split())


if(b+W<a):
    print(a-b-W)
elif(b<=a and a<=b+W):
    print('0')
elif(a<=b and b<=a+W):
    print('0')
elif(a+W<b):
    print(b-a-W)

Solution (Python):
W, a, b = map(int, input().split())
print(max(0, abs(b-a) - W))

Solution (Python):
w, a, b = list(map(int,input().split(" ")))
if b < a:
    a, b = b, a
s = b - a - w
if s < 0:
    print(0)
else:
    print(s)

Solution (Python):
W, a, b = map(int, raw_input().split())

if a+W >= b and a <= b+W:
	print 0
else:
	print min(abs(b-(a+W)), abs(a-(b+W)))

Solution (Python):

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

if a<=b:
    print(max(b-(a+w),0))
else:
    print(max(a-(b+w),0))

Solution (Python):


data = map(int, raw_input().split())

if data[1] <= data[2]:
    if data[2] <= data[1] + data[0]:
        print 0
    else :
        print data[2] - (data[1] + data[0])
else:
    if data[1] > data[2]:
        if data[2] + data[0] >= data[1]:
            print 0
        else:
            print data[1] - (data[2] + data[0])

Solution (Python):
L = input().split()

w=int(L[0])
a=int(L[1])
b=int(L[2])

if a<b:
    if a+w<b:
        move=abs(a+w-b)
        print(move)
    else:
        print(int(0))

elif a>b:
    if b+w<a:
        m=abs(b+w-a)
        print(m)
    else:
        print(int(0))

else:
    print(int(0))

Solution (Python):
l = input().split()

for i in range(len(l)):
    l[i] = int(l[i])

w = l[0]    
a = l[1]
b = l[2]

if a + w < b:
    print(b - a - w)
elif b + w < a:
    print(a - b - w)
else:
    print(0)

Solution (Python):
a, b, c=map(int,input().split())
if(b<c):
	k=c-b-a
	if(k<=0):
		print(0)
	else:
		print(k)
else:
	k=b-a-c
	if(k<=0):
		print(0)
	else:
		print(k)

Solution (Python):
def main():
    W, a, b = map(int, input().split())

    if a > b:
        a, b = b, a
    if b - a <= W:
        print('0')
    else:
        l = b - (a + W)
        print(str(l))

main()

Solution (Python):
w,a,b = map(int, input().split(' '))

if abs(a - b) < w:
    print(0)
elif a < b:
    print(b - a - w)
else:
    print(a - b - w)

Solution (Python):
if __name__ == '__main__':
    w, a, b = map(int, input().split())
    
    if b + w < a: 
        print(a - b - w)
    elif a <= b + w <= a + w or a <= b <= a + w: 
        print(0)
    else: 
        print(b - a - w)

Solution (Python):


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

if a < b:
    ans = b - (a + W)
    if ans < 0:
        print(0)
    else:
        print(ans)

else:
    ans = a - (b + W)
    if ans < 0:
        print(0)
    else:
        print(ans)

Solution (Python):

W, a, b = map(int, input().split())
a2 = a+W
b2 = b+W
if a2 < b:
    print(b - a2)
elif b2 < a:
    print(a - b2)
else:
    print(0)

Solution (Python):
W, a, b = map(int, input().split())

if a-W <= b <= a+W:
 print(0)
elif b < a-W:
 print(a-W-b)
else:
 print(b-(a+W))

Solution (Python):
lines = input().split()
W = int(lines[0])
a = int(lines[1])
b = int(lines[2])
shortest = b-(a+W)
s2 = a-(b+W)
if shortest >= 0 :
    print(shortest)
elif shortest <= 0 and s2>=0:
    print(s2)
else:
    print("0")

Solution (Python):
import math
W, a, b =  map(int, input().split())
c = math.fabs(a - b)
if c > W:
    print(int(c - W))
else:
    print(0)

Solution (Python):

Inp = map(int, raw_input().split())
a = min(Inp[1], Inp[2])
b = max(Inp[1], Inp[2])
l = b - (a + Inp[0])
l = max(0, l)
print(str(l))

Solution (Python):
import sys

INF = 10**9+7

stdin = sys.stdin
def na(): return map(int, stdin.readline().split())
def nal(): return list(map(int, stdin.readline().split()))
def ns(): return stdin.readline().strip()
def nsl(): return list(stdin.readline().strip())
def ni(): return int(stdin.readline())

w, a, b = na()

if((abs(b - a) <= w)):
    print(0)
elif(a < b):
    print(b-(a+w))
else:
    print(a-(b+w))

Solution (Python):


w, a, b =map(int,raw_input().split())  
if a ==b:
    print 0
elif a < b:
    if a + w >= b:
        print 0
    else:
        print b-(a+w)
elif a >b:
    if b + w >= a:
        print 0
    else:
        print a-(b+w)

Solution (Python):
w,a,b = map(int,input().split())
if a+w>=b:
    if a<=b+w:
        print(0)
    elif a>=b+w:
        print(a-b-w)
elif a+w<=b:
    print(b-a-w)

Solution (Python):


a, b, c = map(int, raw_input().split())
result = 0

if b > c:
    t = b
    b = c
    c = t
if a+b >= c:
    result = 0
else:
    result = c - a - b


print result

Solution (Python):
W, a, b = map(int, raw_input().split())
if b >= a and b <= a + W:
    print 0
elif b > a + W:
    print b - (a + W)
else:
    print a - (b + W)

Solution (Python):
w, a, b = map(int, input().split())

if a  + w < b:
    print(b - a - w)
elif b + w < a:
    print(a - b - w)
else:
    print(0)

Solution (Python):
W, a, b = map(int, input().split())
r = min(a,b)
l = max(a,b)
print(0 if (r+W)>=l else l-(r+W))

Solution (Python):
W, a, b = [int(_) for _ in input().split()]

if b >= a:
    res = b - (a + W)
else:
    res = a - (b + W)

print(max(0, res))

Solution (Python):
input_lines = str(input())

W = int(input_lines.split(' ')[0])
a = int(input_lines.split(' ')[1])
b = int(input_lines.split(' ')[2])

if a < b:

    saidai = a + W

    if saidai >= b:
        print('0')
    else:
        print(b - saidai)

elif a > b:

    saidai = b + W

    if saidai >= a:
        print('0')
    else:
        print(a - saidai)

else:
    print('0')