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



Sample input:
3 2 6


Sample output:
1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W,*s=map(int,input().split())
a,b=sorted(s)
print((b-a-W)*(a+W<b))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

tmp = a+W - b

A = set(range(a,a+W))
B = set(range(b,b+W))

if len(A&B):
    print(0)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if abs(b - a) <= w:
    print('0')
else:
    print('{}'.format(min(abs(b-a-w),abs(a-b-w))))

Submission status: Accepted

Solution code:
w,a,b= (int(i) for i in input().split()) 
if a<=b:
  if b<=a+w:
    print(0)
  if a+w<b:
    print(b-a-w)
if a>b:
  if a<=b+w:
    print(0)
  if b+w<a:
    print(a-b-w)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
	ans = 0

print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w,*a=map(int,input().split());print(max(0,max(a)-min(a)-w))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
W, a, b = map(int, input().split())
l1 = b - (a + W)
l2 = a - (b + W)

if l1 < 0 and l2 < 0:
    print(0)
elif l1 > l2:
    print(l1)
else:
    print(l2)

Submission status: Accepted

Solution code:
w,a,b = map(int,input().split())
big = max(a,b)
small = min(a,b)

if small+w >= big:
    print(0)
else:
    print(big-(small+w))

Submission status: Accepted

Solution code:
w, a, b = map(int, input().split())
d = [a-w-b, b-w-a][a<b]
print([0,d][d>0])

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
W, a, b = map(int, input().split())
sorted_list = sorted([a, b])

if W + sorted_list[0] >= sorted_list[1]:
    print(0)
else:
    print(abs(W + sorted_list[0] - sorted_list[1]))

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))
W, a, b = inpl()
if max(a, b)-W-min(a, b)>0:
    print(max(a, b)-W-min(a, b))
else:
    print(0)

Submission status: Accepted

Solution code:
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])

#print(w,a,b)

#print(b-a-w if a<=b else a-b-w)


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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem B

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)]))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)))

Submission status: Accepted

Solution code:
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)))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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


print(k)

Submission status: Accepted

Solution code:
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)))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

    # b <= a <= b + W or a <= b <= a + W:
    # 別の長方形とすでに重なっている
    ans = 0
    if b - (a + W) >= 0:
        # bの左端がaの右側
        ans = b - (a + W)
    elif a - (b + W) >= 0:
        # bの右端がaの左側
        ans = a - (b + W)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# main関数
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

print(res)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
W, a, b = list(map(int, input().split()))
#if (a > b) a, b = b, a
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")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 )

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(max(0, abs))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
#! coding: UTF-8
w,a,b = list(map(int,input().split(" ")))
if (a-w) <= b <= (a+w):
	print(0)
else:
	print(abs(b-a)-w)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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())

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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)))

Submission status: Accepted

Solution code:
[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)))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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")

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
#!/usr/bin/env 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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

print max(0, b-a-w)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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