ZhenlongDai/ACPR huggingface dataset:
Problem: p03089
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
b = list(map(int, input().split()))


enable = True
for i in range(N):
  if b[i] > i + 1:
    enable = False
    break
if not enable:
  print(-1)
else:

  tmp = []
  ans = []
  for i in range(N):
    tmp.append(b[i])
    if i == N - 1 or b[i + 1] == 1:
      tmp.sort(reverse = True)
      for t in tmp:
        ans.append(t)
      tmp = []
  ans.reverse()
  for a in ans:
    print(a)

Failing test case input:
9
1 1 1 2 2 1 4 1 2

Expected output:
1
2
1
1
2
4
2
1
1


Actual output:
1
2
1
4
1
2
2
1
1


Fixed submission (verdict: Accepted):
N = int(input())
b = list(map(int, input().split()))

b.reverse()
ans = []
disable = False

for i in range(N):
  for j in range(len(b)):
    if b[j] == len(b) - j:
      ans.append(b.pop(j))
      break
    if j == len(b) - 1:
      disable = True
      ans = [-1]
      break
  if disable:
    break

ans.reverse()
for a in ans:
  print(a)

Problem: p03089
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = []
n = int(input())
b = [int(i) for i in input().split()]

b = sorted(b)
flag = True

for i in range(n):
    a.append(b[i])
    if b[i] > i+1:
        flag = False

if flag == False:
    print("-1")

else:
    for i in a:
        print(i)

Failing test case input:
9
1 1 1 2 2 1 2 3 2

Expected output:
1
2
2
3
1
2
2
1
1

Actual output:
1
1
1
1
2
2
2
2
3


Fixed submission (verdict: Accepted):
a = []
n = int(input())
b = [int(i) for i in input().split()]

flag = True
for i in range(n):
    if i+1 < b[i]:
        flag = False

for i in range(n):
    a.insert(b[i]-1,b[i])

if flag == False:
    print("-1")

else:
    for i in a:
        print(i)

Problem: p03089
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = []
n = int(input())
b = [int(i) for i in input().split()]

flag = True
if b[0] != 1:
    flag = False

for i in range(n):
    a.insert(b[i]-1,b[i])
    

if flag == False:
    print("-1")

else:
    for i in a:
        print(i)

Failing test case input:
3
1 7 0

Expected output:
-1


Actual output:
1
0
7


Fixed submission (verdict: Accepted):
a = []
n = int(input())
b = [int(i) for i in input().split()]

flag = True
for i in range(n):
    if i+1 < b[i]:
        flag = False

for i in range(n):
    a.insert(b[i]-1,b[i])

if flag == False:
    print("-1")

else:
    for i in a:
        print(i)
Problem: p03089
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
lin = []
for i in range(n):
    if i+1 >= li[i]:
        lin.append(li[i])
    else:
        print(-1)
        exit()
for i in lin:
    print(i)

Failing test case input:
9
1 1 1 1 2 1 4 1 2

Expected output:
1
2
1
1
2
4
1
1
1


Actual output:
1
1
1
1
2
1
4
1
2


Fixed submission (verdict: Accepted):
from sys import stdin
from itertools import groupby

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
lin = []

while li:
    now = 10**10
    for i,j in enumerate(li,1):
        if i == j:
            now = i
    if now == 10**10:
        print(-1)
        exit()
    lin.append(now)
    li.pop(now-1)

for i in lin[::-1]:
    print(i)

Problem: p03089
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))

check = True
for i in range(n):
    if a[i] > i+1:
        check = False
if check:
    ans = []
    start = 0
    while len(a) != 0:
        temp = False
        for i in range(len(a)-1):
            if a[i] >= a[i+1]:
                ans.append(a[i])
                a.pop(i)
                temp = True
                break
        if temp == False:
            ans.append(a[-1])
            a.pop(-1)
    ans.reverse()
    for i in range(n):
        print(ans[i])
else:
    print("-1")

Failing test case input:
9
1 1 1 2 2 1 4 1 2

Expected output:
1
2
1
1
2
4
2
1
1


Actual output:
1
2
1
4
1
2
2
1
1


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

check = True
for i in range(n):
    if a[i] > i+1:
        check = False
if check:
    ans = []
    for i in range(n):
        temp = 0
        tempindex = 0
        for k in range(len(a)):
            if k+1 == a[k]:
                temp = a[k]
                tempindex = k
        ans.append(temp)
        a.pop(tempindex)

    ans.reverse()
    for i in range(n):
        print(ans[i])
else:
    print("-1")
Problem: p03089
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys


import math
import collections

import bisect

import fractions

import copy
import heapq
import decimal

import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    n = ni()
    a = na()

    for i, ai in enumerate(a):
        if ai > i + 1:
            print(-1)
            exit(0)
        else:
            print(ai)


if __name__ == '__main__':
    main()


Failing test case input:
3
-2 0 4

Expected output:
-1


Actual output:
-2
0
-1


Fixed submission (verdict: Accepted):
import sys


import math
import collections

import bisect

import fractions

import copy
import heapq
import decimal

import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    n = ni()
    a = na()

    ans = []
    while len(a) > 0:
        flg = True
        for i in range(len(a) - 1, -1, -1):
            if i + 1 == a[i]:
                ans.append(i + 1)
                del a[i]
                flg = False
                break
        if flg:
            print(-1)
            exit(0)

    for i in range(n-1,-1,-1) :
        print(ans[i])


if __name__ == '__main__':
    main()
Problem: p00102
Buggy submission (Python3, verdict: Wrong Answer):
while True:
	n=int(input())
	if not n: break
	a=[list(map(int,input().split())) for _ in range(n)]
	t=[[0 for _ in range(n+1)] for _ in range(n+1)]
	for i in range(n):
		for j in range(n):
			t[i][j]=a[i][j]
			t[i][n]+=a[i][j]
			t[n][j]+=a[i][j]
			t[n][n]+=a[i][j]
	print(t)

Failing test case input:
4
52 26 16 20
143 22 35 45
45 78 54 36
10 86 74 55
4
52 96 15 28
86 22 24 45
45 78 54 36
16 86 74 55
0

Expected output:
   52   26   16   20  114
  143   22   35   45  245
   45   78   54   36  213
   10   86   74   55  225
  250  212  179  156  797
   52   96   15   28  191
   86   22   24   45  177
   45   78   54   36  213
   16   86   74   55  231
  199  282  167  164  812


Actual output:
[[52, 26, 16, 20, 114], [143, 22, 35, 45, 245], [45, 78, 54, 36, 213], [10, 86, 74, 55, 225], [250, 212, 179, 156, 797]]
[[52, 96, 15, 28, 191], [86, 22, 24, 45, 177], [45, 78, 54, 36, 213], [16, 86, 74, 55, 231], [199, 282, 167, 164, 812]]


Fixed submission (verdict: Accepted):
while True:
	n=int(input())
	if not n: break
	a=[list(map(int,input().split())) for _ in range(n)]
	t=[[0 for _ in range(n+1)] for _ in range(n+1)]
	for i in range(n):
		for j in range(n):
			t[i][j]=a[i][j]
			t[i][n]+=a[i][j]
			t[n][j]+=a[i][j]
			t[n][n]+=a[i][j]
	for i in range(n+1):
		print("".join(map("{0:>5}".format,t[i])))

Problem: p00102
Buggy submission (Python3, verdict: Wrong Answer):
while True:
	n=int(input())
	if not n: break
	a=[list(map(int,input().split())) for _ in range(n)]
	t=[[0 for _ in range(n+1)] for _ in range(n+1)]
	for i in range(n):
		for j in range(n):
			t[i][j]=a[i][j]
			t[i][n]+=a[i][j]
			t[n][j]+=a[i][j]
			t[n][n]+=a[i][j]
	print(a)
	print(t)

Failing test case input:
4
1 26 16 20
268 20 18 23
20 78 103 36
10 86 74 55
4
52 151 40 32
86 22 3 35
38 126 90 9
16 86 74 33
0

Expected output:
    1   26   16   20   63
  268   20   18   23  329
   20   78  103   36  237
   10   86   74   55  225
  299  210  211  134  854
   52  151   40   32  275
   86   22    3   35  146
   38  126   90    9  263
   16   86   74   33  209
  192  385  207  109  893


Actual output:
[[1, 26, 16, 20], [268, 20, 18, 23], [20, 78, 103, 36], [10, 86, 74, 55]]
[[1, 26, 16, 20, 63], [268, 20, 18, 23, 329], [20, 78, 103, 36, 237], [10, 86, 74, 55, 225], [299, 210, 211, 134, 854]]
[[52, 151, 40, 32], [86, 22, 3, 35], [38, 126, 90, 9], [16, 86, 74, 33]]
[[52, 151, 40, 32, 275], [86, 22, 3, 35, 146], [38, 126, 90, 9, 263], [16, 86, 74, 33, 209], [192, 385, 207, 109, 893]]


Fixed submission (verdict: Accepted):
while True:
	n=int(input())
	if not n: break
	a=[list(map(int,input().split())) for _ in range(n)]
	t=[[0 for _ in range(n+1)] for _ in range(n+1)]
	for i in range(n):
		for j in range(n):
			t[i][j]=a[i][j]
			t[i][n]+=a[i][j]
			t[n][j]+=a[i][j]
			t[n][n]+=a[i][j]
	for i in range(n+1):
		print("".join(map("{0:>5}".format,t[i])))
Problem: p00102
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    inputCount = int(input())

    if inputCount == 0:
        break

    table = []

    for lp in range(inputCount):
        content = [int(item) for item in input().split(" ")]
        content.append(sum(content))
        table.append(content)

    table.append([])

    for col in range(inputCount + 1):
        total = 0
        for row in range(inputCount):
            total += table[row][col]

        table[inputCount].append(total)

    output = []
    for array in table:
        content = ["{:>5}".format(str(item)) for item in array]
        output.append(str(content))

    print("\n".join(output))



Failing test case input:
4
52 79 0 20
6 24 35 41
4 94 186 12
10 86 146 52
4
29 45 15 17
86 21 1 29
45 102 94 7
50 132 18 62
0

Expected output:
   52   79    0   20  151
    6   24   35   41  106
    4   94  186   12  296
   10   86  146   52  294
   72  283  367  125  847
   29   45   15   17  106
   86   21    1   29  137
   45  102   94    7  248
   50  132   18   62  262
  210  300  128  115  753


Actual output:
['   52', '   79', '    0', '   20', '  151']
['    6', '   24', '   35', '   41', '  106']
['    4', '   94', '  186', '   12', '  296']
['   10', '   86', '  146', '   52', '  294']
['   72', '  283', '  367', '  125', '  847']
['   29', '   45', '   15', '   17', '  106']
['   86', '   21', '    1', '   29', '  137']
['   45', '  102', '   94', '    7', '  248']
['   50', '  132', '   18', '   62', '  262']
['  210', '  300', '  128', '  115', '  753']


Fixed submission (verdict: Accepted):
while True:
    inputCount = int(input())

    if inputCount == 0:
        break

    table = []

    for lp in range(inputCount):
        content = [int(item) for item in input().split(" ")]
        content.append(sum(content))
        table.append(content)

    table.append([])

    for col in range(inputCount + 1):
        total = 0
        for row in range(inputCount):
            total += table[row][col]

        table[inputCount].append(total)

    for array in table:
        print("".join("{:>5}".format(item) for item in array))
Problem: p03132
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):


L = int(input())
A = [int(input()) for _ in  range(L)]


DP = [0] * 5
for i in range(L):
    r0 = A[i]
    r1 = (A[i] + 1) % 2

    if A[i] == 0:
        r2 = 2
    else:
        r2 = A[i] % 2

    for i,r in zip(range(4,-1,-1), [r0,r2,r1,r2,r0]):
        DP[i] = min(DP[:i+1]) + r
        print(DP)
print(min(DP))
    


Failing test case input:
7
96853219
442714502
846264338
327950288
55894964
937510582
1

Expected output:
1


Actual output:
[0, 0, 0, 0, 96853219]
[0, 0, 0, 1, 96853219]
[0, 0, 0, 1, 96853219]
[0, 1, 0, 1, 96853219]
[96853219, 1, 0, 1, 96853219]
[96853219, 1, 0, 1, 442714502]
[96853219, 1, 0, 0, 442714502]
[96853219, 1, 1, 0, 442714502]
[96853219, 1, 1, 0, 442714502]
[539567721, 1, 1, 0, 442714502]
[539567721, 1, 1, 0, 846264338]
[539567721, 1, 1, 0, 846264338]
[539567721, 1, 2, 0, 846264338]
[539567721, 1, 2, 0, 846264338]
[1385832059, 1, 2, 0, 846264338]
[1385832059, 1, 2, 0, 327950288]
[1385832059, 1, 2, 0, 327950288]
[1385832059, 1, 2, 0, 327950288]
[1385832059, 1, 2, 0, 327950288]
[1713782347, 1, 2, 0, 327950288]
[1713782347, 1, 2, 0, 55894964]
[1713782347, 1, 2, 0, 55894964]
[1713782347, 1, 2, 0, 55894964]
[1713782347, 1, 2, 0, 55894964]
[1769677311, 1, 2, 0, 55894964]
[1769677311, 1, 2, 0, 937510582]
[1769677311, 1, 2, 0, 937510582]
[1769677311, 1, 2, 0, 937510582]
[1769677311, 1, 2, 0, 937510582]
[2707187893, 1, 2, 0, 937510582]
[2707187893, 1, 2, 0, 1]
[2707187893, 1, 2, 1, 1]
[2707187893, 1, 1, 1, 1]
[2707187893, 2, 1, 1, 1]
[2707187894, 2, 1, 1, 1]
1


Fixed submission (verdict: Accepted):


L = int(input())
A = [int(input()) for _ in  range(L)]


DP = [0] * 5
for i in range(L):
    r0 = A[i]
    r1 = (A[i] + 1) % 2

    if A[i] == 0:
        r2 = 2
    else:
        r2 = A[i] % 2

    for i,r in zip(range(4,-1,-1), [r0,r2,r1,r2,r0]):
        DP[i] = min(DP[:i+1]) + r
        

print(min(DP))

Problem: p03132
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
l=int(input())
A=[int(input())for _ in range(l)]
dp=[0]*5
for i in range(l):
    a,b,c,d,e,f=dp+[A[i]]
    p=int(f==0)*2
    dp=[a+f,min(a,b)+f%2+p,min(a,b,c)+(f+1)%2,min(b,c,d)+f%2+p,min(d,e)+f]
print(min(dp))

Failing test case input:
8
2
1
1
2
1
1
0
0

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
l=int(input())
A=[int(input())for _ in range(l)]
dp=[0]*5
for i in range(l):
    a,b,c,d,e,f=dp+[A[i]]
    p=int(f==0)*2
    dp=[a+f,min(a,b)+f%2+p,min(a,b,c)+(f+1)%2,min(b,c,d)+f%2+p,min(b,c,d,e)+f]
print(min(dp))
Problem: p03132
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
zot=lambda x:0 if x==0 else (x+1)%2+1
A=[zot(int(input())) for i in range(n)]
D=[0,0,0,0,0]

for a in A:
  d0 = D[0] + a
  d1 = min(D[:2])+ [2,1,0][a]
  d2 = min(D[:3])+ [1,0,1][a]
  d3 = min(D[:4])+ [2,1,0][a]
  d4 = min(D) + a
  D=[d0,d1,d2,d3,d4]
print(min(D))

Failing test case input:
7
314159265
274050664
846264338
327950288
419716939
937510582
-1

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
zot=lambda x:0 if x==0 else (x+1)%2+1
A=[int(input()) for i in range(n)]
D=[0,0,0,0,0]

for a in A:
  d0 = D[0] + a
  d1 = min(D[:2])+ [2,1,0][zot(a)]
  d2 = min(D[:3])+ [1,0,1][zot(a)]
  d3 = min(D[:4])+ [2,1,0][zot(a)]
  d4 = min(D) + a
  D=[d0,d1,d2,d3,d4]
print(min(D))
Problem: p03525
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
if n==0:
  print(0)
  exit()
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[d[i]-23]+=1
if max(time)>1:
  print(0)
  exit()
ans=0
cnt=0
for i in range(25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans=max(ans,cnt)
    cnt=0
print(ans+1)
    
    

Failing test case input:
3
7 12 8

Expected output:
4

Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[-d[i]]+=1
if max(time)>1:
  print(0)
  exit()
ans=[]
cnt=1
for i in range(1,25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans.append(cnt)
    cnt=1
print(min(ans))

Problem: p03525
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
ns = list(map(int, input().split()))
ns = sorted(ns)
ans = [0] * 24
ans[0] = 1
for i in range(n):
    if i % 2 == 0:
        ans[ns[i]] += 1
    else:
        ans[(24 - ns[i]) % 24] += 1
print(ans)
for i in ans:
    if i >= 2:
        print(0)
        exit()
ans = ans[1:]
print(1+min(len(i) for i in ''.join(map(str, ans)).split('1')))


Failing test case input:
3
7 12 8

Expected output:
4

Actual output:
[1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
4


Fixed submission (verdict: Accepted):
n = int(input())
ns = list(map(int, input().split()))
ns = sorted(ns)
ans = [0] * 24
ans[0] = 1
for i in range(n):
    if i % 2 == 0:
        ans[ns[i]] += 1
    else:
        ans[(24 - ns[i]) % 24] += 1
for i in ans:
    if i >= 2:
        print(0)
        exit()
ans = ans[1:]
print(1+min(len(i) for i in ''.join(map(str, ans)).split('1')))

Problem: p03525
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[d[i]-24]+=1
if max(time)>1:
  print(0)
  exit()
ans=[]
cnt=1
for i in range(25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans.append(cnt)
    cnt=1
print(min(ans))

Failing test case input:
3
7 12 8

Expected output:
4

Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[-d[i]]+=1
if max(time)>1:
  print(0)
  exit()
ans=[]
cnt=1
for i in range(1,25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans.append(cnt)
    cnt=1
print(min(ans))
Problem: p03525
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
if n==0:
  print(0)
  exit()
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[d[i]-24]+=1
if max(time)>1:
  print(0)
  exit()
ans=0
cnt=0
for i in range(25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans=max(ans,cnt)
    cnt=0
print(ans)
    
    

Failing test case input:
3
7 12 8

Expected output:
4

Actual output:
11


Fixed submission (verdict: Accepted):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[-d[i]]+=1
if max(time)>1:
  print(0)
  exit()
ans=[]
cnt=1
for i in range(1,25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans.append(cnt)
    cnt=1
print(min(ans))

Problem: p03525
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
if n==0:
  print(0)
  exit()
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[d[i]-24]+=1
if max(time)>1:
  print(0)
  exit()
ans=0
cnt=0
for i in range(25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans=max(ans,cnt)
    cnt=0
print(ans+1)
    
    

Failing test case input:
3
7 12 8

Expected output:
4

Actual output:
12


Fixed submission (verdict: Accepted):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[-d[i]]+=1
if max(time)>1:
  print(0)
  exit()
ans=[]
cnt=1
for i in range(1,25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans.append(cnt)
    cnt=1
print(min(ans))

Problem: p03525
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())+1
D = list(map(int,input().split()))+[0]
D.sort()
for i in range(1,N,2):
    D[i] = 24-D[i]
ans = 24
for i in range(N):
    ans = min(ans,24-abs(D[i-1]-D[i]))
print(ans)

Failing test case input:
3
7 12 8

Expected output:
4

Actual output:
7


Fixed submission (verdict: Accepted):
N = int(input())+1
D = list(map(int,input().split()))+[0]+[24]
D.sort()
for i in range(1,N,2):
    D[i] = 24-D[i]
D.sort()
ans = 24
for i in range(N):
    ans = min(ans,abs(D[i+1]-D[i]))
print(ans)
Problem: p03525
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from collections import Counter
N = int(input())
D = list(map(int, input().split()))
D.sort()
d = [0]*25
d[0] = d[-1] = 1
for i in range(N):
    if i & 1:
        d[D[i]] += 1
    else:
        d[24-D[i]] += 1
for i in range(25):
    if d[i] > 1:
        print(0)
        exit()
print(d)
last, ans = 0, 24
for i in range(1, 25):
    if d[i]:
        ans = min(i-last, ans)
        last = i
print(ans)


Failing test case input:
3
7 12 8

Expected output:
4

Actual output:
[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1]
4


Fixed submission (verdict: Accepted):
from collections import Counter
N = int(input())
D = list(map(int, input().split()))
D.sort()
d = [0]*25
d[0] = d[-1] = 1
for i in range(N):
    if i & 1:
        d[D[i]] += 1
    else:
        d[24-D[i]] += 1
for i in range(25):
    if d[i] > 1:
        print(0)
        exit()
last, ans = 0, 24
for i in range(1, 25):
    if d[i]:
        ans = min(i-last, ans)
        last = i
print(ans)

Problem: p03525
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
D =[0]+[int(x) for x in input().split()]
m=D[1]
for i in range(1,N+1):
  D[i]=D[i] if i&1 else 24-D[i]
D.sort()
for i in range(1,N+1):
  m= min(m,D[i]-D[i-1])
print(m)
  

Failing test case input:
3
7 12 8

Expected output:
4

Actual output:
1


Fixed submission (verdict: Accepted):
N=int(input())
D =[0]+[int(x) for x in input().split()]
m=D[1]
D.sort()
for i in range(1,N+1):
  D[i]=D[i] if i&1 else 24-D[i]
D.sort()
for i in range(1,N+1):
  m= min(m,D[i]-D[i-1])
print(m)

Problem: p03525
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[d[i]-24]+=1
if max(time)>1:
  print(0)
  exit()
ans=[]
cnt=1
for i in range(1,25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans.append(cnt)
    cnt=1
print(min(ans))

Failing test case input:
3
7 12 8

Expected output:
4

Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
d=list(map(int,input().split()))
d.sort()
time=[0]*24
time[0]=1
for i in range(n):
  if i%2:
    time[d[i]]+=1
  else:
    time[-d[i]]+=1
if max(time)>1:
  print(0)
  exit()
ans=[]
cnt=1
for i in range(1,25):
  i=i%24
  if time[i]==0:
    cnt+=1
  else:
    ans.append(cnt)
    cnt=1
print(min(ans))
Problem: p02261
Buggy submission (Python3, verdict: Wrong Answer):
n=int(input())
c=input().split();d=c[:]
for i in range(n-1):
 for j in range(0,n-i-1):
  if c[j][1]>c[j+1][1]:c[j],c[j+1]=c[j+1],c[j]
 m=d.index(min(d[i:]),i)
 if d[i][1]>=d[m][1]:d[i],d[m]=d[m],d[i]
print(*c);print("Stable")
print(*d)
b={i[1]for i in c}
print(["Stable","Not stable"][len(b)<len(c)])


Failing test case input:
5
H4 C9 S4 D2 C2

Expected output:
D2 C2 H4 S4 C9
Stable
D2 C2 S4 H4 C9
Not stable


Actual output:
D2 C2 H4 S4 C9
Stable
C2 C9 D2 H4 S4
Not stable


Fixed submission (verdict: Accepted):
n=int(input())
c=input().split();d=c[:]
for i in range(n-1):
 for j in range(0,n-i-1):
  if c[j][1]>c[j+1][1]:c[j],c[j+1]=c[j+1],c[j]
 b=[s[1]for s in d];m=b.index(min(b[i:]),i)
 if b[i]>b[m]:d[i],d[m]=d[m],d[i]
print(*c);print("Stable")
print(*d)
print(["Not stable","Stable"][c==d])

Problem: p02261
Buggy submission (Python3, verdict: Wrong Answer):
n=int(input())
c=input().split();d=c[:]
for i in range(n-1):
 for j in range(0,n-i-1):
  if c[j][1]>c[j+1][1]:c[j],c[j+1]=c[j+1],c[j]
 b=[s[1]for s in d];m=b.index(min(b[i:]),i)
 if b[i]>b[m]:d[i],d[m]=d[m],d[i]
print(*c);print("Stable")
print(*d)
print(["Stable","Not stable"][len({i[1]for i in c})<len(c)])


Failing test case input:
5
I3 B9 S4 E3 B3

Expected output:
I3 E3 B3 S4 B9
Stable
I3 E3 B3 S4 B9
Stable


Actual output:
I3 E3 B3 S4 B9
Stable
I3 E3 B3 S4 B9
Not stable


Fixed submission (verdict: Accepted):
n=int(input())
c=input().split();d=c[:]
for i in range(n-1):
 for j in range(0,n-i-1):
  if c[j][1]>c[j+1][1]:c[j],c[j+1]=c[j+1],c[j]
 b=[s[1]for s in d];m=b.index(min(b[i:]),i)
 if b[i]>b[m]:d[i],d[m]=d[m],d[i]
print(*c);print("Stable")
print(*d)
print(["Not stable","Stable"][c==d])
Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = (int(i) for i in input().split())  
if a + b >= c:
  print(b + c)
else:
  print(a + b + b)

Failing test case input:
-1 -101 -1

Expected output:
-202


Actual output:
-203


Fixed submission (verdict: Accepted):
a,b,c = (int(i) for i in input().split())  
if a + b >= c:
  print(b + c)
else:
  print(a + b + b + 1)

Problem: p03186
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    a,b,c=map(int,input().split())
    cnt=0

    if b<=c:
        c-=b
        cnt+=b*2

        if a<c:
            cnt+=a+1
        elif a==c:
            cnt+=a
        else:
            cnt+=c+1

        print(cnt)
    else:
        print(b+c)

resolve()

Failing test case input:
6 -2 0

Expected output:
-2


Actual output:
-1


Fixed submission (verdict: Accepted):
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    a, b, c = map(int, input().split())
    cnt = 0
    if a+b-1>c:
        print(b+c)
    else:
        c -= b
        cnt += b * 2

        if a < c:
            cnt += a + 1
        elif a == c:
            cnt += a
        else:
            if c > 0:
                cnt += c + 1

        print(cnt)



resolve()

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


Failing test case input:
-3 -9 -1

Expected output:
-20


Actual output:
-12


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if c > a + b:
    print(a + 2*b + 1)
else:
    print(b + c)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
if A + B >= C:
    print(B+C)
else:
    print(A+B)

Failing test case input:
1 -8 7

Expected output:
-14


Actual output:
-7


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
if A + B >= C:
    print(B+C)
else:
    print(A+2*B+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if(a+b>=c):
  print(b+c)
else:
  print(2*b+a)

Failing test case input:
-1 -37 0

Expected output:
-74


Actual output:
-75


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if(a+b>=c):
  print(b+c)
else:
  print(2*b+a+1)

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

if c < a+b:
    print(b+c)
else:
    print(b+(b+a))

Failing test case input:
-2 -49 -4

Expected output:
-99


Actual output:
-100


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

if c < a+b:
    print(b+c)
elif a+b < c:
    print(b+(b+a)+1)
else:
    print(b+(b+a))
Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C=map(int,input().split())
if A+B>C or B>C:
  print(B+C)
else:
  print(2*B+A+1)


Failing test case input:
-21 -1 -2

Expected output:
-22


Actual output:
-3


Fixed submission (verdict: Accepted):
A,B,C=map(int,input().split())
if A+B>=C:
  print(B+C)
else:
  print(2*B+A+1)

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



if c <= a + b:
    print(c+b)
elif a <= c:
    print(2*a)
else:
    print(0)


Failing test case input:
-5 -25 -1

Expected output:
-54


Actual output:
-10


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



if c <= a + b + 1 :
    print(c+b)
else:
    print(a+2*b+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
c = max(c, a + b + 1)
print(b + c)


Failing test case input:
1 -10 20

Expected output:
-18


Actual output:
10


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
c = min(c, a + b + 1)
print(b + c)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C=map(int,input().split())
print(B+C if A+B>=C else B+C-1)

Failing test case input:
3 1 27

Expected output:
6


Actual output:
27


Fixed submission (verdict: Accepted):
A,B,C=map(int,input().split())
print(B+C if A+B>=C else A+2*B+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print(b+c if a+b>=c-1 else a+2*b)


Failing test case input:
0 -23 -1

Expected output:
-45


Actual output:
-46


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
print(b+c if a+b>=c-1 else a+2*b+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = (int(i) for i in input().split())
if a + b >= c:
  result = b + c
elif a + b < c:
  result = b + b
print(result)

Failing test case input:
0 -20 0

Expected output:
-39


Actual output:
-40


Fixed submission (verdict: Accepted):
a, b, c = (int(i) for i in input().split())
if a + b + 1 >= c:
  result = b + c
else:
  result = a + 2 * b + 1
print(result)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = (int(i) for i in input().split())
if a + b >= c:
  result = b + c
elif a + b < c:
  result = a + 2*b
print(result)

Failing test case input:
3 0 12

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
a, b, c = (int(i) for i in input().split())
if a + b + 1 >= c:
  result = b + c
else:
  result = a + 2 * b + 1
print(result)
Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inputint = list(map(int,input().split()))

a = inputint[0] + inputint[1]
b = inputint[2]
result = 0
if a >= b:
    result = inputint[1] + b
elif a < b:
    result = inputint[1]*2

print(result)

Failing test case input:
-3 -15 -1

Expected output:
-32


Actual output:
-30


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

a = inputint[0] + inputint[1] + 1
b = inputint[2]
result = 0
if a >= b:
    result = inputint[1] + b
elif a < b:
    result = inputint[1]*2 + inputint[0] + 1

print(result)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C = map(int,input().split())
cnt = min(A+B,C)
print(B+cnt)


Failing test case input:
-2 -28 4

Expected output:
-57


Actual output:
-58


Fixed submission (verdict: Accepted):
A,B,C = map(int,input().split())
cnt = min(A+B+1,C)
print(B+cnt)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())

print(min(A+B, C) + B)


Failing test case input:
-1 -18 -1

Expected output:
-36


Actual output:
-37


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())

print(min(A+B+1, C) + B)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if c <= b+a+2:
  print(b+c)
else:
  print(2*b+a+2)

Failing test case input:
0 -18 -2

Expected output:
-35


Actual output:
-34


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if c <= b+a+1:
  print(b+c)
else:
  print(2*b+a+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
if a+b>=c:
  print(a+c)
else:
  print(2*a+b)

Failing test case input:
0 -101 -1

Expected output:
-201


Actual output:
-101


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
if a+b+1>=c:
  print(b+c)
else:
  print(2*b+a+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = list(map(int, input().split()))

if B >= C:
    print(B+C)
else:
    print(2*B+1)


Failing test case input:
-3 -7 4

Expected output:
-16


Actual output:
-13


Fixed submission (verdict: Accepted):
A, B, C = list(map(int, input().split()))

if (A+B) >= C:
    print(B+C)
else:
    print(A+2*B+1)

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

Failing test case input:
-2 -28 4

Expected output:
-57


Actual output:
-25


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
print(b+c) if a+b>=c else print(a+2*b+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
print(b + min(a + b, c))

Failing test case input:
-2 -82 -4

Expected output:
-165


Actual output:
-166


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
print(b + min(a + b + 1, c))
Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
anti=a+b
if c> anti-1:
    print(a+b)
else :
    print(anti*+1+b)

Failing test case input:
-1 -5 -143

Expected output:
-148


Actual output:
-11


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

if c<= anti+1:
    k= b+c
else :
    k=anti+1+b
    
print(k)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
cnt = B

if C <= A + B:
  cnt += C
else:
  cnt += A+B

print(cnt)

Failing test case input:
1 -8 7

Expected output:
-14


Actual output:
-15


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
cnt = B
 
if C <= A + B:
  cnt += C
else:
  cnt += A+B+1
  
print(cnt)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
if C > (A + B):
  num = A + 2*B
else:
  num = B + C
print(num)

Failing test case input:
1 -8 7

Expected output:
-14


Actual output:
-15


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if c > (a + b):
  num = a + 2*b + 1
else:
  num = b + c
print(num)

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

Failing test case input:
0 -8 5

Expected output:
-15


Actual output:
-10


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
if a+b >= c:
  print(b+c)
else:
  print(b+a+b+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C=map(int,input().split())
if A+B>=C:
  print(B+C)
else:
  print(B*2+1)

Failing test case input:
3 1 27

Expected output:
6


Actual output:
3


Fixed submission (verdict: Accepted):
A,B,C=map(int,input().split())
if A+B>=C:
  print(B+C)
else:
  print(B*2+A+1)

Problem: p03186
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    a, b, c = map(int, input().split())
    cnt = 0

    if b <= c:
        c -= b
        cnt += b * 2

        if a < c:
            cnt += a + 1
        elif a == c:
            cnt += a
        else:
            if c>0:
                cnt += c+1


        print(cnt)
    else:
        print(b + c)


resolve()

Failing test case input:
-14 0 -2

Expected output:
-13


Actual output:
-2


Fixed submission (verdict: Accepted):
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    a, b, c = map(int, input().split())
    cnt = 0
    if a+b-1>c:
        print(b+c)
    else:
        c -= b
        cnt += b * 2

        if a < c:
            cnt += a + 1
        elif a == c:
            cnt += a
        else:
            if c > 0:
                cnt += c + 1

        print(cnt)



resolve()
Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
if A + B >= C:
  print(C + B)
else:
  print(A + B + 1)


Failing test case input:
-2 -74 -4

Expected output:
-149


Actual output:
-75


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
if A + B >= C:
  print(C + B)
else:
  print(A + B + 1 + B)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print(min(a+b,c)+b)

Failing test case input:
-21 -1 -2

Expected output:
-22


Actual output:
-23


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
print(min(a+b+1,c)+b)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C = map(int, input().split())

if C < B:
    print(str(B + C))
elif C < A + B:
    print(str(C + B + 1))
elif C == (A + B):
    print(str(2 * B + A))
else:
    print(str(2 * B + A + 1))

Failing test case input:
-21 -1 -2

Expected output:
-22


Actual output:
-3


Fixed submission (verdict: Accepted):
A,B,C = map(int, input().split())

if C < A + B:
    print(str(B + C))
elif C == (A + B):
    print(str(C + B))
else:
    print(str(2 * B + A + 1))

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
print(min(c,a+b+1)+a+b)

Failing test case input:
-1 -23 -1

Expected output:
-46


Actual output:
-47


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
print(min(c,a+b+1)+b)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print(b+c if a+b>=c else a+2*b)

Failing test case input:
1 -10 20

Expected output:
-18


Actual output:
-19


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
print(b+c if a+b>=c-1 else a+2*b+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int,input().split())
r = 0
if c <= a + b + 1:
  r = b + c
else:
  r = a + b + 1
print(r)

Failing test case input:
-1 -23 -1

Expected output:
-46


Actual output:
-23


Fixed submission (verdict: Accepted):
a, b, c = map(int,input().split())
r = 0
if c <= a + b + 1:
  r = b + c
else:
  r = a + 2 * b + 1
print(r)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
ans = 0
if a+b > c:
  print(b+c)
else:
  print(a+2*b)

Failing test case input:
-1 -20 0

Expected output:
-40


Actual output:
-41


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

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if c<=a+b+1:
  print(b+c)
else:
  print(a+b+b)

Failing test case input:
-2 -20 -1

Expected output:
-41


Actual output:
-42


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if c<=a+b+1:
  print(b+c)
else:
  print(a+b+b+1)
Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())

if c - 1 > a + b:
    if a + b == 0:
        print(1)
    else:
        print(a + b + 2)
else:
    print(b + c)

Failing test case input:
-3 -25 -1

Expected output:
-52


Actual output:
-26


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

if c - 1 > a + b:
    if a + b == 0:
        print(1)
    else:
        print(a + b + 1 + b)
else:
    print(b + c)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input_str = input()


a, b, c = input_str.split()
a = int(a)
b = int(b)
c = int(c)

if a + b >= c:
    print(c * 2 + 1)
else:
    print((a + b) * 2 + 1)

Failing test case input:
-1 1 -27

Expected output:
-26


Actual output:
-53


Fixed submission (verdict: Accepted):
input_str = input()

a, b, c = input_str.split()
a = int(a)
b = int(b)
c = int(c)

if a + b >= c:
    print(b + c)
else:
    print((a+b)*2 +1 - a)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,x = (int(i) for i in input().split())

non_p = a + b
if non_p >= x:
    print(x+b)
else:
    print(x+1)

Failing test case input:
-2 -24 -1

Expected output:
-49


Actual output:
0


Fixed submission (verdict: Accepted):

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

non_p = a + b + 1
if non_p >= x:
    print(x+b)
else:
    print(b+(b+a+1))

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
print(b+c) if a+b >= c else print(2*b+a)

Failing test case input:
-1 -28 4

Expected output:
-56


Actual output:
-57


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
print(b+c) if a+b >= c else print(2*b+a+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = tuple([int(i) for i in input().split()])

if c > a+b+1:
  c = a+b-1
  
print(b+c)

Failing test case input:
0 -10 -2

Expected output:
-19


Actual output:
-21


Fixed submission (verdict: Accepted):
a,b,c = tuple([int(i) for i in input().split()])

if c > a+b+1:
  c = a+b+1
  
print(b+c)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C=map(int,input().split())
if A+B >= C:
  print(C+B)

else:
  print(2*B+A)

Failing test case input:
-3 -9 -1

Expected output:
-20


Actual output:
-21


Fixed submission (verdict: Accepted):
A,B,C=map(int,input().split())
if A+B >= C:
  print(C+B)

else:
  print(2*B+A+1)

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

Failing test case input:
-14 0 -2

Expected output:
-13


Actual output:
9


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if a+b>=c-1:
  ans=b+c
else:
  ans=(a+b)+1+b
print(ans)
Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=[int(x) for x in input().split()]
if(a[0]+a[1]>a[2]):
  print(a[1]+a[2])
else:
  print(2*a[1]+a[0])

Failing test case input:
0 -9 -1

Expected output:
-17


Actual output:
-18


Fixed submission (verdict: Accepted):
a=[int(x) for x in input().split()]
if(a[0]+a[1]>=a[2]):
  print(a[1]+a[2])
else:
  print(2*a[1]+a[0]+1)

Problem: p03186
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b,c = map(int, input().split( ))
print(b + min(c,a+b))

Failing test case input:
-1 -23 -1

Expected output:
-46


Actual output:
-47


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split( ))
print(b + min(c,a+b+1))

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


Failing test case input:
0 -9 -1

Expected output:
-17


Actual output:
-18


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if a+b < c:
    print(a+b+b+1)
else:
    print(b+c)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
print(B + min(A+B,C))

Failing test case input:
0 -10 -2

Expected output:
-19


Actual output:
-20


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
print(B + min(A+B+1,C))

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if c >= a + b +1:
  print(a + 2*b + 1)
else:
  print(a + c )


Failing test case input:
1 0 -60

Expected output:
-60


Actual output:
-59


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
if c >= a + b + 1:
  print(a + b*2 + 1)
else:
  print(b+c)

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

cnt = 0
if a + b >= c:
    ans = a + b
else:
    ans = a + b + 2

print(cnt)

Failing test case input:
-1 -5 -143

Expected output:
-148


Actual output:
0


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

cnt = 0
if a + b + 1>= c:
    ans = b + c
else:
    ans = b + a + b + 1

print(ans)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
anti=a+b
if c> anti-1:
    print(b+c)
else :
    print(anti+1+b)

Failing test case input:
-3 -7 4

Expected output:
-16


Actual output:
-3


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

if c<= anti+1:
    k= b+c
else :
    k=anti+1+b
    
print(k)

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


Failing test case input:
-2 -25 -1

Expected output:
-51


Actual output:
-52


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if a+b < c:
    print(a+b+b+1)
else:
    print(b+c)
Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if (a+b)>=c:
	print(c+b)
else:
	print(a+2*b)

Failing test case input:
-2 -82 -4

Expected output:
-165


Actual output:
-166


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if (a+b)>=c:
	print(c+b)
else:
	print(a+2*b+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if c < a + b + 1: 
    print(b + c)
else:
    print(a + 2 * b -1)

Failing test case input:
-1 -20 0

Expected output:
-40


Actual output:
-42


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if c <= a + b:
    print(b + c)
else:
    print(a + 2 * b + 1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
print(b+c if a+b >= c else a+b+3)


Failing test case input:
-2 -28 4

Expected output:
-57


Actual output:
-27


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
print(b+c if a+b >= c else b*2+a+1)

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

tg_c = b + c
dt_c = a + b

if c <= dt_c:
  print(tg_c)
else:
  print(dt_c + (c - dt_c) + 1)

Failing test case input:
1 -10 20

Expected output:
-18


Actual output:
21


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

tg_c = b + c
dt_c = a + b

if c <= dt_c:
  print(tg_c)
else:
  print(a+b*2+1)

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

if a + b == 0:
    print(1)
if c - 1 > a + b:
    print(a + b + 2)
else:
    print(b + c)

Failing test case input:
-2 -49 -4

Expected output:
-99


Actual output:
-49


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

if c - 1 > a + b:
    if a + b == 0:
        print(1)
    else:
        print(a + b + 1 + b)
else:
    print(b + c)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
ans = 0
if b > c:
  print(b+c)
elif a+b > c:
  print(b+c)
else:
  print(a+b+1)

Failing test case input:
0 -10 -2

Expected output:
-19


Actual output:
-9


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

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if a + b >= c:
  print(b+c)
else:
  print(a+2*b)

Failing test case input:
-2 -82 -4

Expected output:
-165


Actual output:
-166


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if a + b >= c :
  print(b+c)
elif a==b==c==0:
  print(0)
else:
  print(a+2*b+1)

Problem: p03186
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = list(map(int, input().split()))
if a + b >= c:
  print(b + c)
else:
  print(a + b + b)
  
  
    



Failing test case input:
1 -10 20

Expected output:
-18


Actual output:
-19


Fixed submission (verdict: Accepted):
a, b, c = list(map(int, input().split()))
if a + b >= c:
  print(b + c)
else:
  print(a + b + b + 1)