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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
w,a,b=map(int,input().split())
ans=[b-a-w,a-b-w]
if ans[0]<0 and ans[1]<0:
    print(0)
elif ans[0]>=0 and ans[1]<0:
    print(ans[0])
else:
    print(ans[1])

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
longer = max(l[1], l[2])
shorter = min(l[1], l[2])
if longer - shorter-l[0] < 0:
    print(0)
else:
    print(longer - shorter-l[0])

Submission status: Accepted

Solution code:
w, a , b = [int(i) for i in 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())

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())
ans = max(a, b) - (min(a, b)+w)

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

Submission status: Accepted

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

if l[0] + w > l[1]:
  print(0)
else:
  print(l[1]-l[0]-w)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W,a,b = [int(x) for x in input().split()]
dist = abs(a-b)-W
if(dist<=0):
  print(0)
else:
  print(dist)

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

W,a,b = inpl()
al,ar = a,a+W
bl,br = b,b+W

if ar < bl:
    print(bl-ar)
elif br < al:
    print(al-br)
else:
    print(0)

Submission status: Accepted

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

  # 初めから接している場合
  if a<=b+W:
    print(0)
  else:
    print(a-(b+W))

# 下の図形の真上に上の図形がある場合
elif b==a:
  print(0)

# 上の図形が下の図形より右側にある場合
else:

  # 初めから接している場合
  if b<=a+W:
    print(0)
  else:
    print(b-(a+W))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC056B - NarrowRectanglesEasy
w, a, b = list(map(int, input().rstrip().split()))
print(0 if max(a, b) - min(a, b) - w <= 0 else max(a, b) - min(a, b) - w)

Submission status: Accepted

Solution code:



w,a,b=map(int, input().split())
print(max(max([a,b])-(min([a,b])+w),0))

Submission status: Accepted

Solution code:
import sys
from collections import Counter

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

    return (a, a + w), (b, b + w)

def submit():
    a, b = read_input()

    if a[0] < b[0]:
        print(max(b[0] - a[1], 0))
    else:
        print(max(a[0] - b[1], 0))


if __name__ == '__main__':
    submit()

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 = map(int,input().split())

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

print(tate)

Submission status: Accepted

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

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

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

if a1<=b1:
    z=b1-a2
elif b1<=a1:
    z=a-b2

if z<=0:
    print("0")
else:
    print(z)

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

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(max(b-a-w,a-b-w))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    w,a,b = f()
    if a>b:
        a,b = b,a
    aw = a+w
    if aw < b:
        print(b - aw ) 
    else:
        print(0)

solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

a1=a+w
b1=b+w

if a<= b <= a+w or a<= b1 <= a+w:
    print(0)
else:
    x1=abs(b-a)
    x2=abs(b-a1)
    x3=abs(b1-a)
    x4=abs(b1-a1)
    print(min(x1,x2,x3,x4))

Submission status: Accepted

Solution code:
W, a, b = map(int, 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())
if a<=b<=(a+w) or b<=(a+w)<=(b+w):
  print(0)
elif (a+w)<b:
  print(b-(a+w))
else:
  print(abs(a-(b+w)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    W, a, b = map(int, input().split())
    a, b = min(a, b), max(a, b)

    return max(0, b - (a + W))


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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    W,a,b = (int(_) for _ in input().split())
    if(a>b):
        tmp = a
        a = b
        b = tmp
        
    if b-(a+W) <= 0:
        ans = 0
    else:
        ans = b-(a+W)
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a <= b:
    aw = a + W
    ans = max(b - aw, 0)
else:
    bw = b + W
    ans = max(a - bw, 0)

print(ans)

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

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())
ans = 0

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 = map(int, input().split())

if a <= b:
    aw = a + w
    ans = max(b - aw, 0)
else:
    bw = b + w
    ans = max(a - bw, 0)

print(ans)

Submission status: Accepted

Solution code:
def narrow_rectangles_easy(W: int, a: int, b: int) -> int:
    if a + W < b:
        return b - (a + W)
    if b + W < a:
        return a - (b + W)
    return 0


if __name__ == "__main__":
    W, a, b = map(int, input().split())
    ans = narrow_rectangles_easy(W, a, b)
    print(ans)

Submission status: Accepted

Solution code:
W, A, B = map(int, input().split())
print(max(0, A - B - W, B - A - W))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
"""
a,b = LS()
if a == b:
    print("H")
else:
    print("D")
"""

#B
w,a,b = LI()
print(max(max(a,b)-min(a,b)-w,0))
#C
"""

x = I()
a = 0
i = 1
while a < x:
    a += i
    i += 1
print(i-1)
"""

#D
"""
n,k = LI()
a = LI(n)
"""
#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w,a,b=map(int,input().split())
if a<b:
  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: Accepted

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

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

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

Submission status: Accepted

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

mini = 0

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

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

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

ans = max((max(A, B) - (min(A, B) + W)), 0)
print(ans)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
W, a, b = [ int(x) for x in 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=map(int,input().split())
print(max(0,b-(a+W),a-(b+W)))

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

Submission status: Accepted

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

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

print(res)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("GREATER")
    elif (x<y): print("LESS")
    else: print("EQUAL")

def ip():
    return int(input())


#n = ip()                              #入力整数1つ
#n,m= (int(i) for i in input().split())      #入力整数横2つ
w,a,b = (int(i) for i in input().split())    #入力整数横3つ
#n,a,b,c= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(h)]
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意

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

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:
""" AtCoder """

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)

Submission status: Accepted

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

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 b+w<a else 0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

if (b < a):
    a, b = b, a

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

Submission status: Accepted

Solution code:
W, a, b = [int(x) for x 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+W < b:
    result = b-(a+W)
elif a > b+W:
    result = a-(b+W)
else:
    result = 0

print(result)

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=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=map(int,input().split());print(max(0,abs(a-b)-w))

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
x=max(a)
a.remove(x)
print(x-sum(a) if x-sum(a)>0 else 0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

apos = [a, a + W]
bpos = [b, b + W]

secis_left = False if bpos[1] > apos[1] else True
if bpos[0] - apos[1] <= 0 and not secis_left:
    print(0)
    exit(0)
elif apos[0] - bpos[1] <= 0 and secis_left:
    print(0)
    exit(0)

dist = [abs(apos[0] - bpos[1]), abs(bpos[0] - apos[1])]

print(min(dist))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w,a,b=(int(i) for i in input().split())
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:
w,a,b = map(int,input().split())
ans = 0
if b > a:
    if a + w < b:
        ans = b - (a + w)
else:
    if b + w <= a:
        ans = a - (b + w)

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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