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 sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
from operator import mul

INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)



class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def combinations_count(n, r):
    if n < r:
        return 0
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]




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

Solution (Python):
w,a,b=map(int,input().split())
print(max(abs(b-a)-w,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 b >= a:
    ans = b - a - W
else:
    ans = a - b - W

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

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 <= b <= a+W) or (a <= b+W <= a+W):
    print(0)
else:
    if a+W < b:
        print(abs(b-(a+W)))
    elif b+W < a:
        print(abs(a-(b+W)))

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    W, a, b = mi()
    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 = 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())
    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)


if __name__ == '__main__':
    main()

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

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

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

if a+W<b:
  print(b-(W+a))
elif b+W<a:
  print(a-(W+b))
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<=b:
    if b<=a+W:
        print(0)
    else:
        print(b-(a+W))
else:
    if a<=b+W:
        print(0)
    else:
        print(a-(b+W))

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

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

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

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

Solution (Python):
W,a,b=map(int,input().split())
if a<=b:
  if a+W<=b:
    print(b-W-a)
  else:
    print(0)
else:
  if b+W<=a:
    print(a-W-b)
  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())
if a>b:
  a,b = b,a
if a<=b and b<=a+w:
  print(0)
else:
  print(b-(a+w))

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

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

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

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

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

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

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

Solution (Python):
W, a, b = [int(i) for i in input().split()]
result = 0
if abs(a-b) - W >= 0:
    result = abs(a-b) - W

print(result)

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 <= 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 = map(int,input().split())
if a<=b<=a+W or a<=b+W<=a+W: print("0")
else: print(min(abs(a+W-b),abs(b+W-a)))

Solution (Python):

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




if __name__ == '__main__':
    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())
print(max(0,abs(a-b)-W))

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 and b <= a + w) or (a <= b + w and b + w <= a + w):
    print(0)
else:
    print(min(abs(a + w - b), abs(b + w - a)))

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

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())
if a<=b<=a+W or b<=a<=b+W:
    print(0)
else:
    A=[a,a+W]
    B=[b,b+W]
    ans=10**9
    for u in A:
        for v in B:
            ans=min(abs(u-v),ans)
    print(ans)

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

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

Solution (Python):
import sys
W,a,b = map(int,input().split())
if W < 0 or W > 100000:
    sys.exit()
if a < 0 or a > 100000:
    sys.exit()
if b < 0 or b > 100000:
    sys.exit()

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

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

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

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

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

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 = map(int, input().split())
if b<=a+W<=b+W or a<=b+W<=a+W:
    print(0)
else:
    print(min(abs(a-b),abs(a+W-b), abs(b+W-a)))

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

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




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

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 = map(int, input().split())
if a > b: a,b = b,a
if a <= b:
    if a+w < b: print(abs(b-(a+w)))
    else: print(0)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

W, a, b = mapint()
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:
  print(max(0,b-a-w))
else:
  print(max(0,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 abs(a-b) <= W:
  print(0)
else:
  print(abs(a-b)-W)

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

if a > b:
    if bw >= a:
        print(0)
    else:
        print(a-bw)
else:
    if aw >= b:
        print(0)
    else:
        print(b-aw)

Solution (Python):
W, A, B = map(int, input().split())
if A <= B <= A + W or A <= B + W <= A + W or B <= A <= B + W or B <= A + W <= B + W:
    print('0')
    exit()
right_dis = max(0, abs(B - A + W))
left_dis = max(0, abs(A - B + W))
print(min(right_dis, left_dis))

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 = 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())
ans=0
if a<b and a+W<b:
  ans=b-(W+a)
elif a>b and b+W<a:
  ans=a-(W+b)
print(ans)

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

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

xa = abs(a - b-W)
xb = abs(b - a-W)

if (a <= b <=a+W) or (b <= a <= b+W):
    print("0")
else:
    print(min(xa,xb))

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

Solution (Python):
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())
print(max(0,abs(a-b)-w))

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

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

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

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 a <= b <= a+w or b <= a <= b+w:
    print(0)
    exit()
if a < b:
    x = b - (a + w)
    print(x)
elif a > b:
    x = a - (b + w)
    print(x)

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())
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())
if (a <= b <= a+w) or (a <= b+w <= a+w):
    print(0)
elif (a < b) and (a+w < b):
    print(b - a - w)
else:
    print(a - b - w)

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

Solution (Python):

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


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

print(translate(W, a, b))

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

Solution (Python):
def resolve():
    w, a, b = map(int, input().split())
    print(min(abs(b-a-w), abs(a-b-w)) if b-a > w or a-b >w else "0")
resolve()

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

if a<b:
    l = a
    r = b
else:
    l = b
    r = a

if W+l>=r:
    print(0)
else:
    print(r-(W+l))

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

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

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

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))
else:
    print(0)

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

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

Solution (Python):
s = list(map(int, input().split()))
d=abs(s[2]-s[1])
if d>s[0]:
    print(d-s[0])
else:
    print(0)

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

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

Solution (Python):
import sys

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

if a > b:
  temp = a
  a = b
  b = temp
if a == b or a+w == b or w == b:
  ans = 0
  print(ans)
  sys.exit()
else:
  if b > a+w:
    ans = abs(b-(a+w))
  else:
    ans = abs((a+w)-b)

print(ans)

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

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

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

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

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

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

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

print(result)

Solution (Python):

import sys
input = sys.stdin.readline









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

print(max(0, abs(A-B)-W))

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

Solution (Python):
if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    a11 = a[1]
    a12=a11+a[0]

    a21 = a[2]
    a22 = a21 + a[0]

    if (a11 <= a21 and a12 >= a21) or (a11 <= a22 and a12 >= a22):
        print(0)
    elif a11 <= a21 and a22 <=a22:
        print(abs(a12 -a21))
    else:
        print(abs(a11-a22))

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

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

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

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 abs(a-b) < w:
    print(0)
else:
    print(abs(a-b) - w)

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

if b > a:
    print(max(0, b - a - w))
else:
    print(max(0, a - b - 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 = map(int, input().split())
if a <= b <= a + W or a <= b + W <= a + W:
  print(0)
  quit()

print(min(abs(a+W - b), abs(b+W - a)))

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

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 = map(int, input().split())
print(max(0, max(a, b) - (min(a, b) + W)))

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

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

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

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

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())

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

Solution (Python):
import numpy as np

def main():

  W, A, B = map(int, input().split())
  
  A_ = A + W
  B_ = B + W
  
  if (A <= B and B <= A_) or (A <= B_ and B_ <= A_):
    print(0)
    return

  print(min(abs(A_ - B), abs(A - B_)))

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<=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):
def resolve():
    w, a, b = map(int, input().split())

    a1 = a
    a2 = a + w

    b1 = b
    b2 = b + w

    ans = 0
    if a2 < b1:
        ans = b1 - a2
    elif b2 < a1:
        ans = a1 - b2
    else:
        ans = 0
    
    print(ans)

resolve()

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

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

print(ans)

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

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

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

Solution (Python):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    w, a, b = mi()
    a, b = min(a,b), max(a,b)
    print(max(0, b-(a+w)))

if __name__ == "__main__":
    main()

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

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

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

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

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

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

Solution (Python):
def main():
    H, a,b = list(map(int, input().split()))
    ans = max(a,b) - (min(a,b) + H)
    print(ans) if ans >= 0 else print(0)

if __name__ == '__main__':
    main()

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def Yes(): print("Yes"); return
def No(): print("No"); return


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


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


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def Base_10_to_n(X, n):
  if X//n:
    return Base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def Base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





W,a,b = inputIL()

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

Solution (Python):
w,a,b = map(int,input().split())
a1 = a
a2 = a+w
b1 = b
b2 = b+w
if abs(b-a) > w:
    print(min(abs(b1-a2),abs(b2-a1)))

else:
    print(0)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

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

print(ans)

Solution (Python):

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

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

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

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

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

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

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())

ans = b - (a + w)
ans1 = a - (b + w)

if a <= b:
    print(max(ans, 0))
else:
    print(max(ans1, 0))

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 = map(int, input().split())
if a + W >= b:
    if b + W < a:
        print(a - b -W)
    else:
        print(0)
else:
    print(b - a - W)

Solution (Python):
W,a,b =map(int,input().split())
if b>a and b-(a+W)>0:
    print(b-(a+W))
elif b<a and a-(b+W)>0:
    print(a-(b+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):
W,a,b = list(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())
print(max(0, max(a,b) - w - min(a,b)))

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


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):

"""
Created on Wed May 13 14:36:38 2020

@author: shinba
"""

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 = map(int, input().split())
d = b - (a + W) if a < b else a - (b + W)
print(max(d, 0))

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

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

print(ans)

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

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

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

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

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

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

Solution (Python):
w,a,b=map(int,input().split())
minu=min(a,b)
maxi=max(a,b)
print(maxi-(minu+w) if maxi-(minu+w)>0 else 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:
  print(b-(a+w))
elif a-w <= b <= a+w:
  print(0)
else:
  print(a-(b+w))

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

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