ZhenlongDai/ACPR huggingface dataset:
Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
    
n = 12
v = list(map(int, '1 1 1 1 2 2 2 2 2 2 3 3'.split()))

a = Counter(v[0::2]).most_common()
b = Counter(v[1::2]).most_common()
a.append([0,0])
b.append([0,0])
if a[0][0] != b[0][0]:
    print(n - (a[0][1] + b[0][1]))
else:
    print(min(n-(a[1][1]+b[0][1]), n-(a[0][1]+b[1][1])))

Failing test case input:
6
0 120 54 32 190 78

Expected output:
4


Actual output:
7


Fixed submission (verdict: Accepted):
from collections import Counter
    
n = int(input())
v = list(map(int, input().split()))

a = Counter(v[0::2]).most_common()
b = Counter(v[1::2]).most_common()
a.append([0,0])
b.append([0,0])
if a[0][0] != b[0][0]:
    print(n - (a[0][1] + b[0][1]))
else:
    print(min(n-(a[1][1]+b[0][1]), n-(a[0][1]+b[1][1])))

Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

N = int(input())
V = list(map(int, input().split(" ")))

even, odd = [sorted(Counter(V[i::2]).items(), key=lambda x: x[1]) + [[None, 0]] for i in range(2)]
if even[0][0] == odd[0][0]:
	print(min(N-even[0][1]-odd[1][1], N-even[1][1]-odd[0][1]))
else:
	print(N-even[0][1]-odd[0][1])

Failing test case input:
6
0 124 5 2 000 14

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
from collections import Counter

N = int(input())
V = list(map(int, input().split(" ")))

even, odd = [sorted(Counter(V[i::2]).items(), key=lambda x: x[1], reverse=True) + [[None, 0]] for i in range(2)]

if even[0][0] == odd[0][0]:
	print(min(N-even[0][1]-odd[1][1], N-even[1][1]-odd[0][1]))
else:
	print(N-even[0][1]-odd[0][1])

Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
N=int(input())
h=[int(i) for i in input().split()]

h_o_l = len(h[1::2])
h_e_l = len(h[::2])

h_o = collections.Counter(h[1::2])
h_e = collections.Counter(h[::2])

o_ = h_o.most_common()
e_ = h_e.most_common()
o_.append((0,0))
e_.append((0,0))

if o_[0][0] != e_[0][0]:
    print(N-o_[1][1]-e_[1][1])
elif o_[0][0] == e_[0][0]:
    a =min(N-o_[0][1]-e_[1][1],N-e_[0][1]-o_[1][1])
    print(a)

Failing test case input:
6
105 119 105 81 105 119

Expected output:
1


Actual output:
5


Fixed submission (verdict: Accepted):
import collections
N=int(input())
h=[int(i) for i in input().split()]

h_o_l = len(h[1::2])
h_e_l = len(h[::2])

h_o = collections.Counter(h[1::2])
h_e = collections.Counter(h[::2])

o_ = h_o.most_common()
e_ = h_e.most_common()
o_.append((0,0))
e_.append((0,0))

if o_[0][0] != e_[0][0]:
    print(N-o_[0][1]-e_[0][1])
elif o_[0][0] == e_[0][0]:
    a =min(N-o_[0][1]-e_[1][1],N-e_[0][1]-o_[1][1])
    print(a)
Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

n = int(input())

e = []
o = []
for i, v in enumerate(input().split(' ')):
    if i % 2 == 0:
        e.append(int(v))
    else:
        o.append(int(v))

if len(set(e + o)) == 1:
    print(int(len(e + o) / 2))
    exit()

if Counter(e).most_common()[0][1] > Counter(o).most_common()[0][1]:
    print(len(o) - Counter(o).most_common()[0][1])
else:
    print(len(e) - Counter(e).most_common()[0][1])



Failing test case input:
6
-1 120 60 13 190 78

Expected output:
4


Actual output:
2


Fixed submission (verdict: Accepted):
from collections import Counter

n = int(input())

e = []
o = []
for i, v in enumerate(input().split(' ')):
    if i % 2 == 0:
        e.append(int(v))
    else:
        o.append(int(v))

if len(set(e + o)) == 1:
    print(int(len(e + o) / 2))
    exit()

if Counter(o).most_common()[0][0] == Counter(e).most_common()[0][0]:
    ans = min(len(o) - Counter(o).most_common()[1][1] + len(e) - Counter(e).most_common()[0][1], len(o) - Counter(o).most_common()[0][1] + len(e) - Counter(e).most_common()[1][1])
    print(ans)
else:
    print(len(o) - Counter(o).most_common()[0][1] + len(e) - Counter(e).most_common()[0][1])

Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
n=int(input())
V=list(map(int,input().split()))
V_1=[(0,0)]+sorted(Counter([V[i] for i in range(n) if i%2==0]).items(), key=lambda x:x[1])
V_2=[(0,0)]+sorted(Counter([V[j] for j in range(n) if j%2==1]).items(), key=lambda x:x[1])

a,b=V_1[-1],V_2[-1]
if a==b:b=V_2[-2]

cnt=0
for i in range(n):
    if i%2==0:
        if V[i]!=a:cnt +=1
    else:
        if V[i]!=b:cnt +=1

print(cnt)

Failing test case input:
4
7 1 2 1

Expected output:
1


Actual output:
4


Fixed submission (verdict: Accepted):
from collections import Counter

n=int(input())
V=list(map(int,input().split()))
V_1=[(0,0)]+sorted(Counter([V[i] for i in range(n) if i%2==0]).items(), key=lambda x:x[1])
V_2=[(0,0)]+sorted(Counter([V[j] for j in range(n) if j%2==1]).items(), key=lambda x:x[1])

a,b=V_1[-1][0],V_2[-1][0]

if a==b:
    if V_1[-2][1]>V_2[-2][1]:a=V_1[-2][0]
    else:b=V_2[-2][0]

cnt=0
for i in range(n):
    if i%2==0:
        if V[i]!=a:cnt +=1
    else:
        if V[i]!=b:cnt +=1

print(cnt)
Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
N = int(input())
v = list(map(int, input().split()))
if len(set(v)) == 1:
  exit()
ov = [v[i] for i in range(1,len(v),2)]
ev = [v[i] for i in range(0, len(v), 2)]

cov = collections.Counter(ov)
cev = collections.Counter(ev)
mov = max(cov)
mev = max(cev)
if mov == mev:
  if cov[mov] > cev[mev]:
    mev = cev.most_common()[1]
  else:
    mov = cov.most_common()[1]
ans = len(v) - cov[mov] - cev[mev]
print(ans)


Failing test case input:
6
0 36 0 2 011 14

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
import collections
N = int(input())
v = list(map(int, input().split()))
if len(set(v)) == 1:
  print(int(len(v)/2))
  exit()
ov = [v[i] for i in range(1,len(v),2)]
ev = [v[i] for i in range(0, len(v), 2)]

cov = collections.Counter(ov)
cev = collections.Counter(ev)
mov = cov.most_common()[0][0]
mev = cev.most_common()[0][0]
ans = len(v) - cov[mov] - cev[mev]

if mov == mev:
  ans1 = len(v) - cov.most_common()[1][1] - cev.most_common()[0][1]
  ans2 = len(v) - cov.most_common()[0][1] - cev.most_common()[1][1]
  ans = min(ans1, ans2)

print(ans)

Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
 
n = int(input())
v_array = list(map(int,input().split()))
 
v_odd = v_array[0::2]
v_even = v_array[1::2]
 
v_odd_common = Counter(v_odd).most_common()
v_even_common = Counter(v_even).most_common()

v_odd_common.append((0,0))
v_even_common.append((0,0))

print(v_odd_common[0])

if v_odd_common[0] != v_even_common[0]:
    print(n-v_odd_common[0][1]-v_even_common[0][1])
else:
    print(min(n-v_odd_common[0][1]-v_even_common[1][1],n-v_odd_common[1][1]-v_even_common[0][1]))

Failing test case input:
6
-2 124 5 34 243 10

Expected output:
4


Actual output:
(-2, 1)
4


Fixed submission (verdict: Accepted):
from collections import Counter
 
n = int(input())
v_array = list(map(int,input().split()))
 
v_odd = v_array[0::2]
v_even = v_array[1::2]
 
v_odd_common = Counter(v_odd).most_common()
v_even_common = Counter(v_even).most_common()

v_odd_common.append((0,0))
v_even_common.append((0,0))

if v_odd_common[0] != v_even_common[0]:
    print(n-v_odd_common[0][1]-v_even_common[0][1])
else:
    print(min(n-v_odd_common[0][1]-v_even_common[1][1],n-v_odd_common[1][1]-v_even_common[0][1]))
Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
N = int(input())
v = list(map(int, input().split()))

odd = v[0::2]
even = v[1::2]

o = Counter(odd).most_common(2)
e = Counter(even).most_common(2)

ans = int(N/2)
for d1 in o:
    for d2 in e:
        if d1[0]==d2[0] :
            continue
        ans = min(ans, N-d1[1]-d2[1])

print(ans)

Failing test case input:
6
0 120 54 13 190 78

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):

from collections import Counter
N = int(input())
v = list(map(int, input().split()))

odd = v[0::2]
even = v[1::2]

o = Counter(odd).most_common(2)
e = Counter(even).most_common(2)

o.append((0,0))
e.append((0,0))

if o[0][0]==e[0][0]:
    print(min(N-o[0][1]-e[1][1], N-o[1][1]-e[0][1]))
else:
    print(N-o[0][1]-e[0][1])

Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
n=int(input())
a=list(map(int,input().split()))
a1=collections.Counter(a[0::2]).most_common()
a2=collections.Counter(a[1::2]).most_common()
print(a1,a2)
a1.append((0,0))
a2.append((0,0))
if a1[0]!=a2[0]:print(n-a1[0][1]-a2[0][1])
else:print(min(n-a1[0][1]-a2[1][1],n-a1[1][1]-a2[0][1]))

Failing test case input:
6
1 124 4 2 100 14

Expected output:
4


Actual output:
[(1, 1), (4, 1), (100, 1)] [(124, 1), (2, 1), (14, 1)]
4


Fixed submission (verdict: Accepted):
import collections
n=int(input())
a=list(map(int,input().split()))
a1=collections.Counter(a[0::2]).most_common()
a2=collections.Counter(a[1::2]).most_common()
a1.append((0,0))
a2.append((0,0))
if a1[0]!=a2[0]:print(n-a1[0][1]-a2[0][1])
else:print(min(n-a1[0][1]-a2[1][1],n-a1[1][1]-a2[0][1]))

Problem: p03244
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from itertools import groupby

n = int(input())
v = list(map(int, input().split()))
odd = sorted((-len(list(g)), k) for k, g in groupby(v[0::2])) + [(0, None)]
even = sorted((-len(list(g)), k) for k, g in groupby(v[1::2])) + [(0, None)]
if odd[0][1] != even[0][1]:
    print(n + odd[0][0] + even[0][0])
else:
    print(n + max(odd[1][0] + even[0][0], odd[0][0] + even[1][0]))


Failing test case input:
6
0 124 8 2 000 14

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
v = list(map(int, input().split()))
def doit(vs):
    ret = {}
    for v in vs:
        ret[v] = ret.get(v, 0) + 1
    return sorted((-ret[v], v) for v in ret) + [(0, None)]
odd = doit(v[0::2])
even = doit(v[1::2])
if odd[0][1] != even[0][1]:
    print(n + odd[0][0] + even[0][0])
else:
    print(n + min(odd[1][0] + even[0][0], odd[0][0] + even[1][0]))
Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v = list(map(int, input().split()))

v = [v[::2], v[1::2]]

from collections import Counter
from operator import itemgetter
from itertools import product
c = list(map(Counter, v))
s = [sorted(d.items(), key=itemgetter(1), reverse=True) for d in c]
print(s)
s = [(d + [(0, 0)])[:2] for d in s]
keep = 0
for e, o in product(*s):
    print(e, o)
    if e[0] == o[0]:
        continue
    tmp = e[1] + o[1]
    if tmp > keep:
        keep = tmp
ans = n - keep
print(ans)

Failing test case input:
6
-1 124 5 14 243 10

Expected output:
4


Actual output:
[[(-1, 1), (5, 1), (243, 1)], [(124, 1), (14, 1), (10, 1)]]
(-1, 1) (124, 1)
(-1, 1) (14, 1)
(5, 1) (124, 1)
(5, 1) (14, 1)
4


Fixed submission (verdict: Accepted):
n = int(input())
v = list(map(int, input().split()))

v = [v[::2], v[1::2]]

from collections import Counter
from operator import itemgetter
from itertools import product
c = list(map(Counter, v))
s = [sorted(d.items(), key=itemgetter(1), reverse=True) for d in c]
s = [(d + [(0, 0)])[:2] for d in s]
keep = 0
for e, o in product(*s):
    if e[0] == o[0]:
        continue
    tmp = e[1] + o[1]
    if tmp > keep:
        keep = tmp
ans = n - keep
print(ans)

Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
N = int(input())
V = list(map(int, input().split()))
a1, a2, *_ = Counter(V[0::2]).most_common() + [(0, 0)]
b1, b2, *_ = Counter(V[1::2]).most_common() + [(0, 0)]
print(N - max(a1[1] + b2[1], a2[1] + b1[1]) if a1[0] == b1[0] else N - a1[1] + b1[1])


Failing test case input:
6
0 120 54 11 190 78

Expected output:
4


Actual output:
6


Fixed submission (verdict: Accepted):
from collections import Counter
N = int(input())
V = list(map(int, input().split()))
a1, a2, *_ = Counter(V[0::2]).most_common() + [(0, 0)]
b1, b2, *_ = Counter(V[1::2]).most_common() + [(0, 0)]
print(N - max(a1[1] + b2[1], a2[1] + b1[1]) if a1[0] == b1[0] else N - (a1[1] + b1[1]))

Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections

n=int(input())
r=list(map(int,input().split()))

eNum=collections.Counter(r[1::2])
oNum=collections.Counter(r[::2])
eIndex=list(eNum)
oIndex=list(oNum)
eIndex.append(0)
oIndex.append(0)
eNum[0]=0
oNum[0]=0

if eIndex[0]==oIndex[0]:
  print(len(r)-max(eNum[eIndex[0]]+oNum[oIndex[1]],eNum[eIndex[1]]+oNum[oIndex[0]]))
else:
  print(len(r)-eNum[eIndex[0]]-oNum[oIndex[0]])


Failing test case input:
4
7 0 2 1

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
import collections

n=int(input())
r=list(map(int,input().split()))

eNum=collections.Counter(r[1::2]).most_common()
oNum=collections.Counter(r[::2]).most_common()
eNum.append((0,0))
oNum.append((0,0))



if eNum[0][0]==oNum[0][0]:
  print(len(r)-max(eNum[0][1]+oNum[1][1],eNum[1][1]+oNum[0][1]))
else:
  print(len(r)-eNum[0][1]-oNum[0][1])
Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

n = int(input())
v = [int(i) for i in input().split()]

ki = v[::2]
gu = v[1::2]

ki = Counter(ki)
gu = Counter(gu)

ki = ki.most_common()
gu = gu.most_common()

print(ki)
print(gu)

ans = 0

if ki[0][0] == gu[0][0]:
    if len(ki) == 1 and len(gu) == 1:
        ans = int(n / 2)
    else:
        if ki[1][1] > gu[1][1]:
            ans = n - ki[1][1] - gu[0][1]
        else:
            ans = n - ki[0][1] - gu[1][1]
else:
    ans = n - ki[0][1] - gu[0][1]

print(ans)



Failing test case input:
4
10 0 5 1

Expected output:
2


Actual output:
[(10, 1), (5, 1)]
[(0, 1), (1, 1)]
2


Fixed submission (verdict: Accepted):
from collections import Counter

n = int(input())
v = [int(i) for i in input().split()]

ki = v[::2]
gu = v[1::2]

ki = Counter(ki)
gu = Counter(gu)

ki = ki.most_common()
gu = gu.most_common()

ans = 0

if ki[0][0] == gu[0][0]:
    if len(ki) == 1 and len(gu) == 1:
        ans = int(n / 2)
    else:
        if ki[1][1] > gu[1][1]:
            ans = n - ki[1][1] - gu[0][1]
        else:
            ans = n - ki[0][1] - gu[1][1]
else:
    ans = n - ki[0][1] - gu[0][1]

print(ans)

Problem: p03244
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq

n=int(input())
ve=[0 for _ in range(100010)]
vo=[0 for _ in range(100010)]
v = list(map(int,input().split()))

for nn in range(n):
        vv = v[nn]
        if(nn%2==0):
                ve[vv]+=1
        else:
                vo[vv]+=1
hve = heapq.nlargest(2,range(len(ve)),key=ve.__getitem__)
hvo = heapq.nlargest(2,range(len(vo)),key=vo.__getitem__)

s = len(v)
ans = min((2*s-ve[hve[0]]-vo[hvo[1]]),(2*s-ve[hve[1]]-vo[hvo[0]]))

print(ans)


Failing test case input:
6
1 124 4 11 100 14

Expected output:
4


Actual output:
10


Fixed submission (verdict: Accepted):
import heapq

n=int(input())
ve=[0 for _ in range(100010)]
vo=[0 for _ in range(100010)]
v = list(map(int,input().split()))

for nn in range(n):
        vv = v[nn]
        if(nn%2==0):
                ve[vv]+=1
        else:
                vo[vv]+=1
hve = heapq.nlargest(2,range(len(ve)),key=ve.__getitem__)
hvo = heapq.nlargest(2,range(len(vo)),key=vo.__getitem__)

if hve[0]==hvo[0]:
        ans = min((n-ve[hve[0]]-vo[hvo[1]]),(n-ve[hve[1]]-vo[hvo[0]]))
else:
        ans = n-ve[hve[0]]-vo[hvo[0]]

print(ans)
Problem: p00011
Buggy submission (Python3, verdict: Wrong Answer):
w = int(input())
n = int(input())
Ami = []
Num = []
for i in range(n):
    Ami.append(list(map(int,input().split(","))))
print(Ami)
for i in range(1,w+1):
    pos = i
    for j in range(n):
        if pos == Ami[j][0]:
            pos = Ami[j][1]
        elif pos == Ami[j][1]:
            pos = Ami[j][0]
    Num.append([pos,i])
Num = sorted(Num)
for k in range(0,w):
    print(Num[k][1])

Failing test case input:
5
1
2,4
4,5
1,3
4-3

Expected output:
1
4
3
2
5


Actual output:
[[2, 4]]
1
4
3
2
5


Fixed submission (verdict: Accepted):
w = int(input())
n = int(input())
Ami = []
Num = []
for i in range(n):
    Ami.append(list(map(int,input().split(","))))
for i in range(1,w+1):
    pos = i
    for j in range(n):
        if pos == Ami[j][0]:
            pos = Ami[j][1]
        elif pos == Ami[j][1]:
            pos = Ami[j][0]
    Num.append([pos,i])
Num = sorted(Num)
for k in range(0,w):
    print(Num[k][1])

Problem: p00011
Buggy submission (Python3, verdict: Wrong Answer):
def get_another_num(data, me):
    if data[0] == me:
        return data[1]
    else:
        return data[0]


if __name__ == '__main__':
    
    v_lines = 5
    h_lines = 4
    data = [(2, 4), (3, 5), (1, 2), (3, 4)]

    
    results = [0] * (v_lines + 1)
    for i in range(1, v_lines + 1):
        me = i
        for amida in data:
            if me in amida:
                me = get_another_num(amida, me)
        results[me] = i

    
    for i in range(1, v_lines + 1):
        print(results[i])

Failing test case input:
5
4
2,4
4,5
2,1
3,4

Expected output:
4
1
5
3
2


Actual output:
4
1
2
5
3


Fixed submission (verdict: Accepted):
def get_another_num(data, me):
    if data[0] == me:
        return data[1]
    else:
        return data[0]


if __name__ == '__main__':
    
    
    
    
    v_lines = int(input())
    h_lines = int(input())
    data = []
    for i in range(h_lines):
        data.append(tuple(map(int, input().split(','))))


    
    results = [0] * (v_lines + 1)
    for i in range(1, v_lines + 1):
        me = i
        for amida in data:
            if me in amida:
                me = get_another_num(amida, me)
        results[me] = i

    
    for i in range(1, v_lines + 1):
        print(results[i])
Problem: p00011
Buggy submission (Python3, verdict: Wrong Answer):
user = input()
w = int(user)
user = input()
n = int(user)
a = []
b = []
now = 0
for i in range(n):
    user = input()
    users = user.split(",")
    a.append(int(users[0]))
    b.append(int(users[1]))
print(a)
print(b)

for j in range(1, w+1):
    now = j
    for k in reversed(range(n)):
        if now == a[k]:
            now = b[k]
        elif now == b[k]:
            now = a[k]
    print(now)

Failing test case input:
5
0
2,4
4,5
2,1
3-4

Expected output:
1
2
3
4
5


Actual output:
[]
[]
1
2
3
4
5


Fixed submission (verdict: Accepted):
user = input()
w = int(user)
user = input()
n = int(user)
a = []
b = []
now = 0
for i in range(n):
    user = input()
    users = user.split(",")
    a.append(int(users[0]))
    b.append(int(users[1]))

for j in range(1, w+1):
    now = j
    for k in reversed(range(n)):
        if now == a[k]:
            now = b[k]
        elif now == b[k]:
            now = a[k]
    print(now)

Problem: p00011
Buggy submission (Python3, verdict: Wrong Answer):
stick = [i for i in range(1, int(input()) + 1)]

net = int(input())

for _ in range(net):
    a, b = list(map(int, input().split(",")))
    stick[a - 1], stick[b - 1] = stick[b - 1], stick[a - 1]
    print(stick)
print("\n".join(map(str, stick)))

Failing test case input:
5
1
5,1
,54
22-
,44

Expected output:
5
2
3
4
1


Actual output:
[5, 2, 3, 4, 1]
5
2
3
4
1


Fixed submission (verdict: Accepted):
stick = [i for i in range(1, int(input()) + 1)]

net = int(input())

for _ in range(net):
    a, b = list(map(int, input().split(",")))
    stick[a - 1], stick[b - 1] = stick[b - 1], stick[a - 1]
for v in stick:
    print(v)

Problem: p00011
Buggy submission (Python3, verdict: Wrong Answer):
w=int(input())
n=int(input())
A=[int(i+1) for i in range(w)]
for i in range(n):
	x,y=map(int,input().split(','))
	A[x-1],A[y-1]=A[y-1],A[x-1]
print(A)

Failing test case input:
5
4
4,2
4,5
3,1
3,4

Expected output:
3
4
5
1
2


Actual output:
[3, 4, 5, 1, 2]


Fixed submission (verdict: Accepted):
w=int(input())
n=int(input())
A=[int(i+1) for i in range(w)]
for i in range(n):
	x,y=map(int,input().split(','))
	A[x-1],A[y-1]=A[y-1],A[x-1]
for i in range(w):
	print(A[i])

Problem: p00011
Buggy submission (Python3, verdict: Wrong Answer):
import sys
n = int(sys.stdin.readline().rstrip())
m = int(sys.stdin.readline().rstrip())
l = []
for i in range(m):
    l.append(list(map(int, sys.stdin.readline().rstrip().split(','))))
print(l)
for i in range(n):
    cur = i+1
    for d in l[::-1]:
        if cur in d:
            cur = d[0] if cur == d[1] else d[1]
    print(cur)

Failing test case input:
5
1
1,4
5,4
21,
,34

Expected output:
4
2
3
1
5


Actual output:
[[1, 4]]
4
2
3
1
5


Fixed submission (verdict: Accepted):
import sys
n = int(sys.stdin.readline().rstrip())
m = int(sys.stdin.readline().rstrip())
l = []
for i in range(m):
    l.append(list(map(int, sys.stdin.readline().rstrip().split(','))))
for i in range(n):
    cur = i+1
    for d in l[::-1]:
        if cur in d:
            cur = d[0] if cur == d[1] else d[1]
    print(cur)
Problem: p00011
Buggy submission (Python3, verdict: Wrong Answer):



import sys
import math

w = int(input())
n = int(input())
s = []

for _ in range(n):
    x = input().split(',')
    s.append((int(x[0]), int(x[1])))

result = [i for i in range(1, w+1)]
print(len(result))

for x, y in s:
    result[x-1], result[y-1] = result[y-1], result[x-1]

for x in result:
    print(x)

Failing test case input:
5
1
4,1
,54
-20
,44

Expected output:
4
2
3
1
5


Actual output:
5
4
2
3
1
5


Fixed submission (verdict: Accepted):



import sys
import math

w = int(input())
n = int(input())
s = []

for _ in range(n):
    x = input().split(',')
    s.append((int(x[0]), int(x[1])))

result = [i for i in range(1, w+1)]

for x, y in s:
    result[x-1], result[y-1] = result[y-1], result[x-1]

for x in result:
    print(x)

Problem: p00011
Buggy submission (Python3, verdict: Wrong Answer):
def main():
    LIST=[]
    for i in range(int(input())):
        LIST.append(i+1)

    for j in range(int(input())):
        a,b=map(int,input().split(","))
        LIST[a-1],LIST[b-1]=LIST[b-1],LIST[a-1]

    for i in LIST:
        print(i)

Failing test case input:
5
4
4,2
3,5
1,2
3,4

Expected output:
4
1
2
5
3


Actual output:

Fixed submission (verdict: Accepted):
def main():
    LIST=[]
    for i in range(int(input())):
        LIST.append(i+1)

    for j in range(int(input())):
        a,b=map(int,input().split(","))
        LIST[a-1],LIST[b-1]=LIST[b-1],LIST[a-1]

    for i in LIST:
        print(str(i))
            
    
if __name__ == '__main__':
    main()
Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int, input().split())
if a < b:
  print(min(0, a+w-b))
else:
  print(min(0, b+w-a))

Failing test case input:
1 -231 1

Expected output:
231


Actual output:
-231


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
w, a, b = map(int, input().split())
if b > a + w:
    print(b - (a + w))
elif b <= a + w or b >= a- w:
    print(0)
else:
    print(a - (b + w))

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int, input().split())

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

Failing test case input:
0 1 36

Expected output:
35


Actual output:
1


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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()

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
def main():
    W ,a, b = map(int,input().split(" "))
    if W + a > b and a < b + W:
        print("0")
    elif a < b:
        print(b - (a + W))
    elif a > b:
        print(a - (b + W))
    

if __name__ == '__main__':
    main()

Problem: p03778
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
w,a,b = map(int,input().split())
aw = a+w
bw =b+w
print(min(abs(a-b),abs(b-aw),abs(bw-a)))

Failing test case input:
-1 -1 100

Expected output:
102


Actual output:
100


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())
aw = a+w
bw =b+w
print(max(0,a-bw,b-aw))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int, input().split())

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

Failing test case input:
2 -47 -1

Expected output:
44


Actual output:
0


Fixed submission (verdict: Accepted):
w, a, b = map(int, input().split())

if abs(a - b) <= w:
	print(0)
else:
	print(abs(a-b) - w)
Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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()

Failing test case input:
3 -88 -1

Expected output:
84


Actual output:
0


Fixed submission (verdict: Accepted):
def main():
    x = input().split()

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

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

    print(0)

if __name__ == '__main__':
    main()

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b=map(int,input().split())
if (w+a)<b:
  print(b-w-a)
else:
  print(0)

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b=map(int,input().split())
if (w+a)<b:
  print(b-w-a)
elif (b+w)<a:
  print(a-b-w)
else:
  print(0)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int,input().split())
if abs(b - a- w) >= abs(a - b):
    print(abs(a-b))
elif a <= b <= a+w:
    print(0)
else:
    print(abs(b - a - w))

Failing test case input:
-1 -1 111

Expected output:
113


Actual output:
112


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())
if a <= b <= a+w or a <= b <= a+w:
    print(0)
elif a+w < b:
    print(b-a-w)
else:
    print(a-b-w)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int,input().split())

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

Failing test case input:
8 10 1

Expected output:
1


Actual output:
9


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())

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

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int,input().split())
if w+a >= b:
  print(0)
else:
	print(b-(a+w))


Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())

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

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b=map(int,input().split())
print(0 if w+a>=b else abs(w+a-b))

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b=map(int,input().split())
print(max(abs(a-b)-w,0))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
W, a, b = map(int, input().split())
print(max(min(abs(a - b - W), abs(a - b + W)), 0))

Failing test case input:
-1 -62 2

Expected output:
65


Actual output:
63


Fixed submission (verdict: Accepted):
W, a, b = map(int, input().split())
print(max(max(a, b) - (min(a, b) + W), 0))
Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
W,a,b = map(int,input().split())
print(b-(a+W))

Failing test case input:
8 10 1

Expected output:
1


Actual output:
-17


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())
print(max(0,abs(a-b)-w))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
W, a, b = map(int, input().split())
if a + W < b:
    print(b - (a + W))
elif a - W <= b or b <= a + W:
    print('0')
else:
    print(a - (b + W))

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
W, a, b = map(int, input().split())
if a + W < b:
    print(b - (a + W))
elif a - W <= b and b <= a + W:
    print('0')
else:
    print(a - (b + W))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = [int(i) for i in input().split()]
ans = b - (a+w)
print(ans if ans > 0 else 0)

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w, a, b = [int(i) for i in input().split()]
if a - b <= 0:
    ans = b - (a+w)
else:
    ans = a - (b+w)

print(ans if ans > 0 else 0)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int,input().split())

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

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



Failing test case input:
8 10 1

Expected output:
1


Actual output:
-1


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())

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

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

Problem: p03778
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
w,a,b=map(int,input().split())
print(max(0,b-a-w))


Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b=map(int,input().split())
print(max(0,a-b-w,b-a-w))

Problem: p03778
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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)

Failing test case input:
-1 -40 1

Expected output:
42


Actual output:
0


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):


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


Failing test case input:
-3 -2 100

Expected output:
105


Actual output:
0


Fixed submission (verdict: Accepted):


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()
Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int, input().split())
if a < b < a + w and a - w < b < a:
    print(0)
elif not a < b < a + w:
    print(b - a - w)
elif not a - w < b < a:
    print(a - b - w)

Failing test case input:
8 10 1

Expected output:
1


Actual output:
-17


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
W, a, b = map(int, input().split())

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


Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
W, a, b = map(int, input().split())

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

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int, input().split())
print(max(0, (b - a) - w))

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w, a, b = map(int, input().split())
print(max(0, abs(b - a) - w))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
W, a, b = map(int, input().split())
print(max(0, b - (a+W)))

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
W, a, b = map(int, input().split())
print(max(0, b - (a+W), a - (b+W)))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b=map(int,input().split())
print(min(abs(a-b)-w,0))


Failing test case input:
-1 -1 100

Expected output:
102


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b=map(int,input().split())
print(max(abs(a-b)-w,0))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int, input().split())
d = [b+w-a, b-w-a][a<b]
print([0,d][d>0])


Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w, a, b = map(int, input().split())
d = [a-w-b, b-w-a][a<b]
print([0,d][d>0])

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
W,a,b=map(int,input().split(' '))
print(min(max(0,b-(a+W)),max(0,a-(b+W))))

Failing test case input:
4 -160 -1

Expected output:
155


Actual output:
0


Fixed submission (verdict: Accepted):
W,a,b=map(int,input().split(' '))
print(max(0,b-(a+W))) if a<=b else print(max(0,a-(b+W)))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

Failing test case input:
-3 -1 100

Expected output:
104


Actual output:
0


Fixed submission (verdict: Accepted):

w,a,b=map(int,input().split())
if a>b:
    tmp=a 
    a=b 
    b=tmp 
if b<a+w:
    print(0)
else:
    print(b-a-w)
Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
-1 -55 -1

Expected output:
55


Actual output:
-55


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
w,a,b = map(int,input().split())

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

Failing test case input:
-1 -1 139

Expected output:
141


Actual output:
0


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int,input().split())
print(min(abs(a-b-w),abs(b-a-w)))

Failing test case input:
-1 -37 -1

Expected output:
37


Actual output:
35


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())
print(max(abs(a-b)-w,0))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
W,a,b = map(int,input().split())
if b <= a+W or a <= b+W:
    print(0)
elif a+W < b:
    print(b-(a+W))
else:
    print(a-(b+W))

Failing test case input:
12 -29 -1

Expected output:
16


Actual output:
0


Fixed submission (verdict: Accepted):
W,a,b = map(int,input().split())
if (b <= a+W and a <= b) or (a <= b+W and b <= a):
    print(0)
elif a+W < b:
    print(b-(a+W))
else:
    print(a-(b+W))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int,input().split())
if (a <= b <= a+w) or (a <= b <= a+w):
    print(0)
elif a+w < b:
    print(b-a-w)

Failing test case input:
8 10 1

Expected output:
1


Actual output:

Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())
if a <= b <= a+w or a <= b <= a+w:
    print(0)
elif a+w < b:
    print(b-a-w)
else:
    print(a-b-w)

Problem: p03778
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
w,a,b = map(int,input().split())
c = b - a
if c - w >= 0:
    print(c - w)
else:
    print(0)

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int,input().split())
if abs(a-b) >= w:
    print(0)
else:
    print(abs(a-b)-w)

Failing test case input:
-1 -116 1

Expected output:
118


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())
if abs(a-b) <=w:
    print(0)
else:
    print(abs(a-b)-w)
Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int,input().split())
c = min(a,b)
d = max(a,b)
if c + w >= d:
  print(0)
else:
  print(d-c+w)



Failing test case input:
-1 -30 2

Expected output:
33


Actual output:
31


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

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = [int(x) for x in input().split()]


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

print(ans)

Failing test case input:
2 0 61

Expected output:
59


Actual output:
63


Fixed submission (verdict: Accepted):
w, a, b = [int(x) for x in input().split()]


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

print(ans)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int, input().split())
if a< b < a + w  or a < b + w < a + w :
    ans = 0
else :
    ans = min(abs(b-(a+w)), abs(b+w-a))
print(ans)

Failing test case input:
-1 -30 0

Expected output:
31


Actual output:
29


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int, input().split())

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

Failing test case input:
-1 -1 7

Expected output:
9


Actual output:
7


Fixed submission (verdict: Accepted):
w, a, b = map(int, input().split())

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

print(r)

Problem: p03778
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
w,a,b = map(int,input().split())

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

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())

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

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int,input().split())

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


Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w, a, b = map(int,input().split())

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

Problem: p03778
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
w, a, b = map(int, input().split())

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

Failing test case input:
0 -78 0

Expected output:
78


Actual output:
-78


Fixed submission (verdict: Accepted):
w, a, b = map(int, input().split())

if w >= abs(a-b):
    print(0)
else:
    if a > b:
        print(a-(b+w))
    else:
        print(b-(a+w))
Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
1 -47 -1

Expected output:
45


Actual output:
47


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b=map(int,input().split())

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

Failing test case input:
-1 -30 -1

Expected output:
30


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b=map(int,input().split())

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

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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())


Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
import sys

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

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


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

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
-1 -55 -2

Expected output:
54


Actual output:
52


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b=map(int,input().split())

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

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
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))

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
0 0 83

Expected output:
83


Actual output:
-83


Fixed submission (verdict: Accepted):
w,a,b = map(int, input().split())
if a+w<b:
    print(abs(a+w-b))
elif b+w<a:
    print(abs(a-b-w))
else:
    print(0)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int,input().split())
if w+a > b:
  print(0)
else:
	print(b-(a+w))

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())

if abs(a-b) <= w:
  print(0)
else:
  print(abs(a-b)-w)
Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b=map(int,input().split())
if abs(a-b)<=w:
    print(abs(a-b)-w)
else:
    print(0)
    

Failing test case input:
1 1 45

Expected output:
43


Actual output:
0


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = [ int(v) for v in input().split() ]

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

Failing test case input:
0 -62 1

Expected output:
63


Actual output:
58


Fixed submission (verdict: Accepted):
w, a, b = [ int(v) for v in input().split() ]

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

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w, a, b = map(int, input().split())
d = min(a+w-b, b+w-a)
print([0,d][d>0])

Failing test case input:
2 -160 -1

Expected output:
157


Actual output:
0


Fixed submission (verdict: Accepted):
w, a, b = map(int, input().split())
d = [a-w-b, b-w-a][a<b]
print([0,d][d>0])

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
8 10 1

Expected output:
1


Actual output:
10


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
W,a,b=map(int,input().split())
 
if a+W<b:
  print(b-(W+a))
else:
  print(0)

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
W,a,b=map(int,input().split())

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

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
W,a,b = map(int, input().split())
ans = b - (W+a)
print(ans if ans > 0 else 0)

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
W,a,b = map(int, input().split())
if a>b:
  tmp = a
  a = b
  b = tmp
ans = b-(W+a)
print(ans if ans > 0 else 0)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
W,a,b=map(int,input().split())
if (b-a-W>0):
 print (b-a-W)
else:
 print (0)

Failing test case input:
8 10 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
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)

Problem: p03778
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
w,a,b = map(int,input().split())
if abs(a-b) >w:
    print(0)
else:
    print(abs(a-b)-w)

Failing test case input:
0 -1 91

Expected output:
92


Actual output:
0


Fixed submission (verdict: Accepted):
w,a,b = map(int,input().split())
if abs(a-b) <=w:
    print(0)
else:
    print(abs(a-b)-w)