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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# input=lambda :sys.stdin.readline().rstrip()
def resolve():
    w,a,b=map(int,input().split())
    if(a>=b): a,b=b,a
    print(max(0,b-a-w))
resolve()

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())
print(max(0, abs(a - b) - W))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    w, a, b = list(map(int, input().rstrip('\n').split()))
    if a + w < b:
        print(abs(a + w - b))
    elif b + w < a:
        print(abs(b + w - a))
    else:
        print(0)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:

w,a,b=map(int,input().split())
ar=a+w 
br=b+w 
if a<=b<ar or a<=br<=ar:
    print(0)
else: 
    a1=abs(br-a)
    a2=abs(ar-b)
    print(min(a1,a2))

Submission status: Accepted

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

Submission status: Accepted

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

if a < b:
    m = b-a-W
else:
    m = a-b-W

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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+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<=a+W or b<=a<=b+W:
  print("0")
else:
  mina=a
  maxa=a+W
  minb=b
  maxb=b+W
  print(abs(min(abs(mina-minb),abs(mina-maxb),abs(maxa-minb),abs(maxa-maxb))))

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())
ans = abs(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 <= a+W) or (a-W<= b <= 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())
print('0' if b<=a<=b+w or b<=a+w<=b+w else min(abs(a-b-w),abs(a+w-b)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
w,a,b = map(int,input().split())
s = {int(i) for i in range(a,a+w+1)} & {int(i) for i in range(b,b+w+1)}
if s:
    print(0)
else:
    if a+w < b:
        print(b-a-w)
    elif b+w < a:
        print(a-b-w)

Submission status: Accepted

Solution code:
W, *N = [int(n) for n in input().split()]
N.sort()
print(max(0, N[1] - W - N[0]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if wa < b:
    print(abs(b-wa))
elif wb < a:
    print(abs(a-wb))
else:
    print(0)

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:

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

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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=(int(i) for i in input().split())

if a > b:
    x = a
    a = b
    b = x

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w,a,b = list(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 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)*(a-b) <w*w:
  print(0)
else:
  print( max(a,b) - min(a,b) -w)

Submission status: Accepted

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W, A, B = map(int, input().split())
if abs(B - 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())

tmp = max(a, b) - min(a + w, b + w)

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

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

Submission status: Accepted

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

W, A, B = ISI()
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())
ans = 0
if abs(a - b) < w:
    ans = 0
else:
    ans = abs(a - b) - w
print(ans)

Submission status: Accepted

Solution code:
import sys
import copy
import string
import  math
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

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

elif a>b+w:
  ans=a-(b+w)

print(ans)

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    test()

Submission status: Accepted

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

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

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

# output
print(ans)

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())
print([0,max(a,b)-min(a,b)-w][max(a,b)-min(a,b)-w>0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    W, a, b = map(int, input().split())
    if b >= a+W:
        return b-a-W
    elif a > b+W:
        return a-b-W
    else:
        return 0

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

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:
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop
# https://atcoder.jp/contests/abc056/tasks/abc056_b

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w,a,b = map(int,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:
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
##############################

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
arr=sorted([a,b])
print(max(0,arr[1]-w-arr[0]))

Submission status: Accepted

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 and a<=b+w:
  print(0)
else:
  print(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:
# B - NarrowRectanglesEasy
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 or b <= a <= b+W:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


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

Submission status: Accepted

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

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

print(max(d - (c + W), 0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    W,a,b = inputMap()
    tmp1 = abs((a+W) - b)
    tmp2 = abs(a-(b+W))
    
    if b <= (a+W) and b >= a:
        print(0)
        sys.exit()
    if b+W <= (a+W) and b+W >= a:
        print(0)
        sys.exit()
    print(min(tmp1,tmp2))
    
    
if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC056b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
w,*a, = list(map(int, input().split()))
aa = sorted(a)

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

Submission status: Accepted

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

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