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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 56 B

def resolve():
    w, a, b = map(int, input().split())
    ans = 0

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

    print(ans)


if __name__ == "__main__":
    resolve()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

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


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W,a,b=[int(x) for x 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(0, b-a-w))
else:
    print(max(0, 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:
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(W: int, a: int, b: int):
    if (b-a-W)*(b+W-a) < 0:
        print(0)
    else:
        print(min(abs(b-a-W), abs(b+W-a)))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    solve(W, a, b)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
W, a, b = map(int, input().split())
a_box = [i for i in range(a, a+W+1)]
b_box = [i for i in range(b, b+W+1)]

if a_box[0] in b_box or a_box[-1] in b_box:
    print(0)
else:
    if a < b:
        print(abs((a+W)-b))
    elif a > b:
        print(abs(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(a+w - b,), abs(-a+b+w)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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







if __name__ == '__main__':
    main()

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 = map(int, input().split())
a_list = [a, a+w]
b_list = [b, b+w]
if a_list[0]>b_list[1]:
    print(a_list[0]-b_list[1])
elif a_list[1]<b_list[0]:
    print(b_list[0]-a_list[1])
else:
    print(0)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

ans = maxx-(minx+w)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC 56, B - narrow rectangles easy
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())

aw = a + w
bw = b + w

if aw < b:
  print(b-aw)
elif bw < a:
  print(a-bw)
else:
  print(0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

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

#B
def B():
    w, a, b = LI()
    a, b = min(a, b), max(a, b)
    if w + a >= b:
        print(0)
        return
    print(b-a-w)
    return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    w,a,b=map(int,input().split(' '))
    print(max(abs(a-b)-w,0))
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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:
import sys
w,a,b=map(int,input().split())
if b>a+w:
  resul=b-a-w
elif a>b:
  b+=w
  resul=a-b
elif a+w>=b or a==b:
  resul=0
print(resul)

Submission status: Accepted

Solution code:
MOD = 10**9 + 7

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

Submission status: Accepted

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

    rt = max(0, b - a - w, a - b - w)

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

    print(rt)


if __name__ == "__main__":

    main()

Submission status: Accepted

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

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

    print(rt)


if __name__ == "__main__":

    main()

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 b > a+W:

    print (b - (a+W))

elif a > b+W:

    print (a - (b + W))

else:

    print(0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(W: int, a: int, b: int):
    ret = max(0, abs(a - b) - W)
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    solve(W, a, b)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

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

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())
start = max(a, b)
end = min(a+W, b+W)
print(max(start-end, 0))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
a = list(map(int,input().split()))
b = [a[1],a[2]]
c = sorted(b)
print(max(c[1]-c[0]-a[0],0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
W,a,b = [int(x) for x in stdin.readline().rstrip().split()]
dist = abs(a-b)
ans = max(dist-W,0)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

if a <= b:
    left, right = a + W, b
else:
    left, right = b + W, a

ans = max(0, right - left)
print(ans)

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

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

W,a,b = list(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())
#N=input()
if b<a:
    a,b=b,a
print(max(b-a-W,0))

Submission status: Accepted

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

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:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

W, a, b = nl()

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

Submission status: Accepted

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


abc()

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:
# B問題
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, b = b, a

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
	main()

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

Submission status: Accepted

Solution code:
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


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

li = [0, b-(a+w), a-(b+w)]

print(max(li))

Submission status: Accepted

Solution code:
w, a, b = map(int,input().split())
a1,a2 = a, a+w
b1,b2 = b, b+w
c1 = b1 - a2
c2 = a1 - b2
#print(c1, c2)
if c1 < 0 and c2 >= 0:
  print(c2)
elif c2 < 0 and c1 >= 0:
  print(c1)
elif c1 < 0 and c2 < 0:
  print(0)

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
import string

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
#
# N, M = list(map(int, sys.stdin.readline().split()))
# A, B = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(N)]))
# C, D = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(M)]))
#
# C = np.array(C)
# D = np.array(D)
#
# for a, b in zip(A, B):
#     c = abs(C - a)
#     d = abs(D - b)
#     xy = (c + d).argmin()
#     print(xy + 1)


W, A , B = list(map(int, sys.stdin.readline().split()))
a = max(0, max(A, B) - (min(A, B) + W))
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = abs(b-a)

answer = max(0,d-W)
print(answer)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W, a, b = [int(i) for i in input().split()]
if b > a + W:
    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())
ma = max(a,b)
mi = min(a,b)
print(max(ma-(mi+w),0))

Submission status: Accepted

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

block1 = [a,a+w]
block2 = [b,b+w]

if a > b:
    tmp = block1
    block1 = block2
    block2 = tmp

if block1[0] <= block2[0] <= block1[1]:
    print(0)
else:
    print(block2[0] - block1[1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

desk=[a,b]
desk=sorted(desk)

#print(desk)

desk[0]=desk[0]+w

if desk[1]-desk[0]>0:
    print(desk[1]-desk[0])

else:
    print("0")

Submission status: Accepted

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

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:
def smaller(x, y):
	if x < y: return x
	return y

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
l = list(map(int,input().split()))
W = l[0];
a = l[1];
b = l[2];

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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())
right = b-a-W
left = a-b-W
distant = max(right,left)
print(0 if distant <= 0 else distant)

Submission status: Accepted

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

if a <= b:
    while True:
        if a + W + count >= b:
            print(count)
            break
        else:
            count += 1

if a > b:
    while True:
        if a <= b + W + count:
            print(count)
            break
        else:
            count += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - NarrowRectanglesEasy
https://atcoder.jp/contests/abc056/tasks/abc056_b

"""
import sys


def solve(W, a, b):
    if a > b:
        a, b, = b, a
    return max(0, b-(a+W))


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


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(W, a, b):
    if a > b:
        a, b = b, a
    print(max(0, b - (a + W)))

#solve(3, 2, 6)
#solve(3, 1, 3)
#solve(5, 10, 1)

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

Submission status: Accepted

Solution code:
W,a,b = (int(i) for i in input().split())
#desk_A,desk_B = [a,a+W],[b,b+W]
if a <= b <= a+W or a <= b+W <= a+W:
    print(0)
    exit()
if 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 b <= a <= b+W:
    print(0)
else:
    print(min([abs(b-(a+W)), abs(a-(b+W))]))

Submission status: Accepted

Solution code:
from sys import exit, stdin
W, a, b = [int(_) for _ in stdin.readline().rstrip().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(0 if abs(a - b) <= w else abs(a - b) - w)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

w, *arr = map(int, input().split())
arr.sort()
diff = arr[1] - (arr[0]+w)
print(diff if diff >= 1 else 0)

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

mod = 10**9+7


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

ans = min(abs(b-a-W),abs(b+W-a))
if a <= b and b-a <= W or b<=a and a-b <=W:
    ans = 0

print(ans)

Submission status: Accepted

Solution code:
x,a,b=map(int,input().split())
print(max(max(a,b)-min(a,b)-x,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())
tmp = max(A,B) - min(A,B) - W
print(tmp if tmp > 0 else 0)

Submission status: Accepted

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

Submission status: Accepted

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