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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,a,b = map(int,input().split())
aw = a+w
bw =b+w
print(min(abs(a-b),abs(b-aw),abs(bw-a),abs(bw-aw)))

Submission status: Wrong Answer

Solution code:
w,a,b = map(int,input().split())
aw = a+w
bw =b+w
print(min(abs(b-aw),abs(bw-a)))

Submission status: Wrong Answer

Solution code:
w,a,b = map(int,input().split())
aw = a+w
bw =b+w
print(min(abs(a-b),abs(b-aw),abs(bw-a)))

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print(min(abs(a-b),abs(a-c)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,a,b=map(int,input().split())
if len(sorted(set(range(a,a+w+1)) | set(range(b,b+w+1)))) !=0:
  print("0")
elif b>=a+w:
  print(b-a-w)
elif a>=b+w:
  print(a-b-w)

Submission status: Wrong Answer

Solution code:
w,a,b=map(int,input().split())
if len(sorted(set(range(a,a+w+1)) | set(range(b,b+w+1)))) ==0:
  print("0")
elif b>=a+w:
  print(b-a-w)
elif a>=b+w:
  print(a-b-w)

Submission status: Wrong Answer

Solution code:
w,a,b=map(int,input().split())
if len(sorted(set(range(a,a+w+1)) | set(range(b,b+w+1)))) ==0:
  print("0")
else:
  print(min(abs(b-a-w),abs(a-b-w)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
w,a,b=map(int,input().split())
if b>a:
    if b-w-a>0:
        print(b-w-a)
    else:print(0)
if a>b:
    if a-w-b>0:
        print(a-w-b)
    else:
        print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    w, a, b = i_map()

    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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

x = b-(a+w)
y = a-(b+w)

if x<=0 or y<=0:
  print(0)
else:
  ans = min(x,y)
  print(ans)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

print(min(xa,xb))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(b-(w+a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,a,b=map(int, input().split())
print(min([abs(b-a-W),abs(a-b-W)]))

Submission status: Wrong Answer

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

A=min(a,b)

B=max(a,b)

if A+w>B:
  print(B-A-w)
else:
  print(0)

Submission status: Wrong Answer

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

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

ans1=b-a-w
ans2=a-b-w

print(min(ans1,ans2))

Submission status: Wrong Answer

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

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

print(min(a-b-w,b-a-w))

Submission status: Wrong Answer

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

print(min(a-b-w,b-a-w))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#abc056 b 
w,a,b=map(int,input().split())
print(min(abs(b+w-a),abs(a+w-b)))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

A = a + W

if b - A <= 0:
    print(0)
else:
    print(b-A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def wab(w,a,b):
    ans = 0
    if w+a >= b and a < b or a <= b+w and a > b:
        return ans
    ans = b - (w + a) if a < b else a - (w + b)
    return ans

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

if a>b and b+W >= a:
    print(0)
    exit()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

B_A = (b-a)

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

Submission status: Wrong Answer

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

aw = a + w
bw = b + w
if (a < b and aw > b) or (b < a and bw > a):
    print(0)
else:
    ab1 = abs(b-aw)
    ab2 = abs(a-bw)
    print(min(ab1, ab2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
w,a,b = map(int, input().split())
if a+w>b or b+w>a:
  print(0)
elif a+w<b:
  print(b-a-w+1)
elif b+w<a:
  print(a-b-w+1)

Submission status: Wrong Answer

Solution code:
W, a, b = map(int, input().split())
candi = [abs(b - a), abs(b + W - a), abs(b - a - W)]
print(min(candi))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

a1 = a
a2 = a+w
b1 = b
b2 = b+w

if a1==b1 and a2==b2 :
	print(0)
elif a1<=b2<=a2 :
	print(0)
elif a1<=b1<=a2 :
	print(0)
elif a2 < b1 :
	print(b1 - a2)
elif a1 > b2 :
	print(b2 - a1)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print(max([b,c])-min([b,c])-a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,a,b = map(int, input().split())
a1 = a
a2 = a+W
b1 = b
b2 = b+W
if b1 <= a <= b2 or b1 <= a2 <= b2:
  print('NO')
else:
  if a2 < b1:
    print(b1 - a2)
  else:
    print(a1 - b2)

Submission status: Wrong Answer

Solution code:
W,a,b = map(int,input().split())
a_r = a + W
b_r = b + W
if((b < a_r and a_r < b_r) or ( b<a and a < b_r)):
    print(0)
else:
    ans = abs(b - a) - W
    print(ans)

Submission status: Wrong Answer

Solution code:
W,a,b = map(int,input().split())
a_r = a + W
b_r = b + W
if((b < a_r and a_r < b_r) or ( b<a and a < b_r)):
    print(0)
else:
    ans = max(b - a_r,a - b_r)
    print(ans)

Submission status: Wrong Answer

Solution code:
W,a,b = map(int,input().split())
a_r = a + W
b_r = b + W
if((b < a_r and a_r < b_r) or ( b<a and a < b_r)):
    print(0)
else:
    ans = min(b - a_r,a - b_r)
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
vals = sorted(list(map(int,input().split())))
print(min(vals[1]-vals[0],vals[2]-vals[1]))

Submission status: Wrong Answer

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

aa = a + W
bb = b + W

if aa < b:
  print(b - aa)
elif bb < a:
  print(a - bb)
elif a < b:
  print(aa - b)
else:
  print(bb - a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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