Problem:


Score : 200 points

Problem Statement

AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W.
If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], and the second rectangle covers the vertical range of [1,2] and the horizontal range of [b,b+W], as shown in the following figure:

AtCoDeer will move the second rectangle horizontally so that it connects with the first rectangle.
Find the minimum distance it needs to be moved.

Constraints

All input values are integers.

1≤W≤10^5

1≤a,b≤10^5

Input

The input is given from Standard Input in the following format:

W a b

Output

Print the minimum distance the second rectangle needs to be moved.

Sample Input 1

3 2 6

Sample Output 1

1

This input corresponds to the figure in the statement. In this case, the second rectangle should be moved to the left by a distance of 1.

Sample Input 2

3 1 3

Sample Output 2

0

The rectangles are already connected, and thus no move is needed.

Sample Input 3

5 10 1

Sample Output 3

4



Sample input:
3 2 6


Sample output:
1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a >= b:
    b = b + W
else:
    a = a + W


print(abs(a-b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


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







if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:



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







if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
MOD = 10**9 + 7

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

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

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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-a, 0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if a!=b:
  if w>abs(a-b):
    print(0)
  else:
    edge=min(a,b)
    print(max(a,b)-(edge+w))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ass = min(abs(a-b),abs(a-b-w),abs(a+w-b))

print(ass)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d1 = b-a-w
d2 = a-b-w

if d1 < 0 and d2 < 0:
    print(0)
elif d1 > 0 and d2 < 0:
    print(d1)
elif d1 < 0 and d2 > 0:
    print(d2)
else:
    print(min(d1, d2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

W, a, b = (int(i) for i in input().split(" "))

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

Submission status: Wrong Answer

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

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

print(b-(a+W))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# B - NarrowRectanglesEasy
# 問題URL:http://abc056.contest.atcoder.jp/tasks/abc056_b

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

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

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

Submission status: Wrong Answer

Solution code:
# B - NarrowRectanglesEasy
# 問題URL:http://abc056.contest.atcoder.jp/tasks/abc056_b

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print max(0, b-a+w)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    x = input().split()

    W = int(x[0])
    a = int(x[1])
    b = int(x[2])

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

    print(0)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    x = input().split()

    W = int(x[0])
    a = int(x[1])
    b = int(x[2])

    if a+W >= b or a <= b+W:
        print(0)
        return

    l = [a,a+W,b,b+W]
    l.remove(min(l))
    l.remove(max(l))
    print(max(l) - min(l))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    x = input().split()

    W = int(x[0])
    a = int(x[1])
    b = int(x[2])

    if a+W > b or a < b+W:
        print(0)
        return

    l = [a,a+W,b,b+W]
    l.remove(min(l))
    l.remove(max(l))
    print(max(l) - min(l))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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


def is_joined(W, a, b):
    if a < b and a + W >= b:
        return True
    elif b + W >= a:
        return True

    return False


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

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


def is_joined(W, a, b):
    if a < b and a + W >= b:
        return True
    elif b < a and b + W >= a:
        return True

    return False


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

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


def is_joined(W, a, b):
    if a < b and a + W >= b:
        return True
    elif b < a and b + W >= a:
        return True

    return False


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

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


def is_joined(W, a, b):
    if a < b and a + W > b:
        return True
    elif b < a and b + W > a:
        return True

    return False


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
i = map(int, raw_input().split(" "))
l = abs(i[1] - i[2])
print( l if (l > i[0]) else 0)

Submission status: Wrong Answer

Solution code:

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

width = b - (a + W)

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

Submission status: Wrong Answer

Solution code:
i = map(int, raw_input().split(" "))
l = abs(i[1] - i[2])
print( l if (l > i[0] / 2.) else 0)

Submission status: Wrong Answer

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

def main(w,a,b):
	if a+w >= b:
		return 0
	else:
    		return b-(a+w)

Submission status: Wrong Answer

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

def main(w,a,b):
	if a+w >= b:
		return 0
	else:
    		return b-(a+w)

Submission status: Wrong Answer

Solution code:
def main(w,a,b):
	if a+w >= b:
		return 0
	else:
    		return b-(a+w)

Submission status: Wrong Answer

Solution code:
def main(w,a,b):
    return b-(a+w)

Submission status: Wrong Answer

Solution code:
l = input().split()
a=int(l[1])
b=int(l[2])

X=abs(a-b)

print(X)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a, b, c = map(int, raw_input().split())
result = 0
if a+b >= c:
    result = 0
else:
    result = c - a - b

# 出力
print result

Submission status: Wrong Answer

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


if(b+W<a):
    print(a-b-W)
elif(math.fabs(b-a)<W):
    print('0')
elif(a+W<b):
    print(b-a-W)

Submission status: Wrong Answer

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

Submission status: Accepted

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


def solve(W: int, a: int, b: int):
    if abs(a-b) <= W:
        return 0
    return abs(a-b) - W

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(W, a, b))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

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


def solve(W: int, a: int, b: int):
    if a <= b <= a+W or b <= a <= b+W:
        return 0
    return min(min(abs(aa-bb) for bb in [b, b+W]) for aa in [a, a+W])

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(W, a, b))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def answer(w: int, a: int, b: int) -> int:
    b_a = abs(b - a)
    if b_a <= w:
        return 0
    return b_a - w


def main():
    w, a, b = map(int, input().split())
    print(answer(w, a, b))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if B <= A <= B+W or B <= A+W <= B+W or A <= B <= A+W or A <= B+W <= A+W:
  print(0)
elif W + A <= B:
  print(B - (W + A))
else:
  print(A - (B + W))

Submission status: Accepted

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