ZhenlongDai/ACPR huggingface dataset:
Buggy program (verdict: Wrong Answer):
a,b,c = input().split()
answer = int(c) - (int(a) - int(b)) 
print(answer)

Failing test case input:
12 0 7

Expected output:
0


Actual output:
-5


Fixed program (verdict: Accepted):
a,b,c = input().split()
answer = int(c) - (int(a) - int(b)) 
if answer >= 0:
    print(answer)
else:
    print(0)

Diff:
 a,b,c = input().split()
 answer = int(c) - (int(a) - int(b)) 
-print(answer)
+if answer >= 0:
+    print(answer)
+else:
+    print(0)
Buggy program (verdict: Wrong Answer):
N = int(input())
A = input().split(' ')
a = 0
sum = 0
for i in range(1, N):
    sum += int(A[i])
for i in range(N):
    a += int(A[i]) *  sum
    if i < N - 1:
        sum -= int(A[i + 1])
    a %= (10e9 + 7)
    
    
print(int(a))

Failing test case input:
4
141421356 5143928 4405286 176612

Expected output:
471127930


Actual output:
6479946586


Fixed program (verdict: Accepted):
N = int(input())
A = input().split(' ')
a = 0
sum = 0
for i in range(1, N):
    sum += int(A[i])
for i in range(N):
    a += int(A[i]) *  sum
    if i < N - 1:
        sum -= int(A[i + 1])
    
print(int(a % (10 ** 9 + 7)))

Diff:
 N = int(input())
 A = input().split(' ')
 a = 0
 sum = 0
 for i in range(1, N):
     sum += int(A[i])
 for i in range(N):
     a += int(A[i]) *  sum
     if i < N - 1:
         sum -= int(A[i + 1])
-    a %= (10e9 + 7)
     
-    
-print(int(a))
+print(int(a % (10 ** 9 + 7)))
Buggy program (verdict: Wrong Answer):
A, B, K = map(int, input().split())
ans = []
for i in range(K):
  if A + i < B:
    ans.append(A + i)
  if B - i > A:
    ans.append(B - i)
ANS = list(set(ans))
ANS.sort()
[print(j) for j in ANS]

Failing test case input:
6 6 110

Expected output:
6


Actual output:

Fixed program (verdict: Accepted):
A, B, K = map(int, input().split())
ans = []
for i in range(K):
  if A + i <= B:
    ans.append(A + i)
  if B - i >= A:
    ans.append(B - i)
ANS = list(set(ans))
ANS.sort()
[print(j) for j in ANS]

Diff:
 A, B, K = map(int, input().split())
 ans = []
 for i in range(K):
-  if A + i < B:
+  if A + i <= B:
     ans.append(A + i)
-  if B - i > A:
+  if B - i >= A:
     ans.append(B - i)
 ANS = list(set(ans))
 ANS.sort()
 [print(j) for j in ANS]
Buggy program (verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))

ans = 1000000000
tmp = 0

for i in range(1, N):
    if H[i - 1] >= H[i]:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0

ans = min(ans, tmp)

print(ans)


Failing test case input:
4
0 4 0 10

Expected output:
1


Actual output:
0


Fixed program (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))

ans = 0
tmp = 0

for i in range(1, N):
    if H[i - 1] >= H[i]:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0

ans = max(ans, tmp)

print(ans)


Diff:
 N = int(input())
 H = list(map(int, input().split()))
 
-ans = 1000000000
+ans = 0
 tmp = 0
 
 for i in range(1, N):
     if H[i - 1] >= H[i]:
         tmp += 1
     else:
         ans = max(ans, tmp)
         tmp = 0
 
-ans = min(ans, tmp)
+ans = max(ans, tmp)
 
 print(ans)
Buggy program (verdict: Wrong Answer):
N,K=map(int,input().split())
while(1):
	A=N%K
	if N<K:
		print(min(N,abs(N-K)))
		exit()
	elif A==0:
		print(0)
		exit()
	else:
		print(A)
		exit()

Failing test case input:
74 47

Expected output:
20


Actual output:
27


Fixed program (verdict: Accepted):
N,K=map(int,input().split())
while(1):
	A=N%K
	if N<K:
		print(min(N,abs(N-K)))
		exit()
	elif A==0:
		print(0)
		exit()
	else:
		print(min(A,abs(A-K)))
		exit()

Diff:
 N,K=map(int,input().split())
 while(1):
 	A=N%K
 	if N<K:
 		print(min(N,abs(N-K)))
 		exit()
 	elif A==0:
 		print(0)
 		exit()
 	else:
-		print(A)
+		print(min(A,abs(A-K)))
 		exit()
Buggy program (verdict: Wrong Answer):
n = int(input()) 
ns = list(map(int, input().split()))



print(*ns[::-1])   



Failing test case input:
5
54 0 -8 -2 1

Expected output:
-8 54 45


Actual output:
1 -2 -8 0 54


Fixed program (verdict: Accepted):
n = int(input()) 
ns = list(map(int, input().split()))


print(min(ns),max(ns),sum(ns))



Diff:
 n = int(input()) 
 ns = list(map(int, input().split()))
 
 
-
-print(*ns[::-1])   
+print(min(ns),max(ns),sum(ns))
Buggy program (verdict: Wrong Answer):
N, x = map(int, input().split())
arr = list(map(int, input().split()))
ans = 0
for i in range(1,N):
    if arr[i-1] + arr[i] >= x:
        if arr[i-1] <= x:
            ans += (arr[i] + arr[i-1]) - x
            arr[i] -= (arr[i] + arr[i-1]) - x
        else:
            ans += arr[i]
            arr[i] = 0
            if x-arr[i-1] > 0:
                ans += x-arr[i-1]
                arr[i-1] -= x-arr[i-1]
            else:
                ans += arr[i-1]
                arr[i-1] = 0
print(ans)

Failing test case input:
6 1
2 6 1 2 0 5

Expected output:
13


Actual output:
14


Fixed program (verdict: Accepted):
N, x = map(int, input().split())
arr = list(map(int, input().split()))
s = sum(arr)
for i in range(1,N):
    if arr[i-1] + arr[i] >= x:
        if arr[i-1] <= x:
            arr[i] -= (arr[i] + arr[i-1]) - x
        else:
            arr[i] = 0
            if x-arr[i-1] > 0:
                arr[i-1] -= x-arr[i-1]
            else:
                arr[i-1] -= arr[i-1]-x
print(s-sum(arr))

Diff:
 N, x = map(int, input().split())
 arr = list(map(int, input().split()))
-ans = 0
+s = sum(arr)
 for i in range(1,N):
     if arr[i-1] + arr[i] >= x:
         if arr[i-1] <= x:
-            ans += (arr[i] + arr[i-1]) - x
             arr[i] -= (arr[i] + arr[i-1]) - x
         else:
-            ans += arr[i]
             arr[i] = 0
             if x-arr[i-1] > 0:
-                ans += x-arr[i-1]
                 arr[i-1] -= x-arr[i-1]
             else:
-                ans += arr[i-1]
-                arr[i-1] = 0
-print(ans)
+                arr[i-1] -= arr[i-1]-x
+print(s-sum(arr))
Buggy program (verdict: Wrong Answer):
n = int(input())
p_li = list(map(int,input().split()))
min_v = p_li[0]
ans=1
for x in p_li:
    if x == 1:
        break
    if min_v>=x:
        min_v=x
    else:
        ans+=1
print(ans)

Failing test case input:
6
-1 3 3 5 5 9

Expected output:
1


Actual output:
6


Fixed program (verdict: Accepted):
n = int(input())
p_li = list(map(int,input().split()))
min_v = p_li[0]
ans=1
for x in p_li:
    if min_v>x:
        min_v=x
        ans+=1
print(ans)

Diff:
 n = int(input())
 p_li = list(map(int,input().split()))
 min_v = p_li[0]
 ans=1
 for x in p_li:
-    if x == 1:
-        break
-    if min_v>=x:
+    if min_v>x:
         min_v=x
-    else:
         ans+=1
 print(ans)
Buggy program (verdict: Wrong Answer):
N = int(input())
cnt_all = 0

if N >=106:
    for i in range(1,N+1):
        cnt =0
        for j in range(1,i+1):
            if i%j ==0:
                cnt +=1
        if cnt ==8 and i%2 ==1:
            cnt_all+=1
    print(cnt_all)

else:
    print(1)
   

Failing test case input:
-153

Expected output:
0


Actual output:
1


Fixed program (verdict: Accepted):
N = int(input())
cnt_all = 0

if N >=106:
    for i in range(1,N+1):
        cnt =0
        for j in range(1,i+1):
            if i%j ==0:
                cnt +=1
        if cnt ==8 and i%2 ==1:
            cnt_all+=1
    print(cnt_all)

elif N==105:
    print(1)
else:
    print(0)

Diff:
 N = int(input())
 cnt_all = 0
 
 if N >=106:
     for i in range(1,N+1):
         cnt =0
         for j in range(1,i+1):
             if i%j ==0:
                 cnt +=1
         if cnt ==8 and i%2 ==1:
             cnt_all+=1
     print(cnt_all)
 
-else:
+elif N==105:
     print(1)
-   
+else:
+    print(0)
Buggy program (verdict: Wrong Answer):
a=input()
b=input()
c=a+b
if c==3:
    print(3)
elif c==4:
    print(2)
else:
    print(1)

Failing test case input:
3
001

Expected output:
2


Actual output:
1


Fixed program (verdict: Accepted):
a=int(input())
b=int(input())

c=a+b
if c==3:
    print(3)
elif c==4:
    print(2)
else:
    print(1)

Diff:
-a=input()
-b=input()
+a=int(input())
+b=int(input())
+
 c=a+b
 if c==3:
     print(3)
 elif c==4:
     print(2)
 else:
     print(1)
Buggy program (verdict: Wrong Answer):
N,M =map(int,input().split())
a = [int(input()) for i in range(M)]
DP = [1]*N
mod = 10**9 + 7
for i in a:
    DP[i-1] = 0
if(N != 1):
    for i in range(N):
        if(DP[i] != 0):
            if(i<1):
                DP[i+1] = DP[i]%mod
            else:
                DP[i] = (DP[i-2] + DP[i-1])%mod
else:
    DP = [1]
print(DP[-1])

Failing test case input:
4 1
2

Expected output:
1


Actual output:
5


Fixed program (verdict: Accepted):
N,M =map(int,input().split())
a = [int(input()) for i in range(M)]
DP = [1]*N
mod = 10**9 + 7
for i in a:
    DP[i-1] = 0
if(N != 1):
    for i in range(N):
        if(DP[i] != 0):
            if(i<1):
                DP[i] = DP[i-1]%mod
            else:
                DP[i] = (DP[i-2] + DP[i-1])%mod
else:
    DP = [1]
print(DP[-1])

Diff:
 N,M =map(int,input().split())
 a = [int(input()) for i in range(M)]
 DP = [1]*N
 mod = 10**9 + 7
 for i in a:
     DP[i-1] = 0
 if(N != 1):
     for i in range(N):
         if(DP[i] != 0):
             if(i<1):
-                DP[i+1] = DP[i]%mod
+                DP[i] = DP[i-1]%mod
             else:
                 DP[i] = (DP[i-2] + DP[i-1])%mod
 else:
     DP = [1]
 print(DP[-1])
Buggy program (verdict: Wrong Answer):
def insertion(S):
    Sc = S
    Scc = Sc.replace("()", "")
    while Scc != Sc:
        Sc = Scc
        Scc = Scc.replace("()", "")

    
    print(Sc)
    if len(Sc) == 0:
        Sl, Sr = "", ""
    elif Sc[0] != Sc[-1]:
        pos = Sc.find(")(")
        Sl = insertion(Sc[:pos+1])[0]
        Sr = insertion(Sc[pos+1:])[2]
    elif Sc[0] == '(':
        Sl = ""
        Sr = ')' * len(Sc)
    else:
        Sl = '(' * len(Sc)
        Sr = ""

    return Sl, S, Sr

N = int(input())
s = insertion(input())
print(s[0]+s[1]+s[2])


Failing test case input:
8
)(((()))

Expected output:
()(((())))


Actual output:
)(
)
(
()(((())))


Fixed program (verdict: Accepted):
def insertion(S):
    Sc = S
    Scc = Sc.replace("()", "")
    while Scc != Sc:
        Sc = Scc
        Scc = Scc.replace("()", "")

    
    
    if len(Sc) == 0:
        Sl, Sr = "", ""
    elif Sc[0] != Sc[-1]:
        pos = Sc.find(")(")
        Sl = insertion(Sc[:pos+1])[0]
        Sr = insertion(Sc[pos+1:])[2]
    elif Sc[0] == '(':
        Sl = ""
        Sr = ')' * len(Sc)
    else:
        Sl = '(' * len(Sc)
        Sr = ""

    return Sl, S, Sr

N = int(input())
s = insertion(input())
print(s[0]+s[1]+s[2])


Diff:
 def insertion(S):
     Sc = S
     Scc = Sc.replace("()", "")
     while Scc != Sc:
         Sc = Scc
         Scc = Scc.replace("()", "")
 
     
-    print(Sc)
+    
     if len(Sc) == 0:
         Sl, Sr = "", ""
     elif Sc[0] != Sc[-1]:
         pos = Sc.find(")(")
         Sl = insertion(Sc[:pos+1])[0]
         Sr = insertion(Sc[pos+1:])[2]
     elif Sc[0] == '(':
         Sl = ""
         Sr = ')' * len(Sc)
     else:
         Sl = '(' * len(Sc)
         Sr = ""
 
     return Sl, S, Sr
 
 N = int(input())
 s = insertion(input())
 print(s[0]+s[1]+s[2])
Buggy program (verdict: Wrong Answer):
S=input()
W=["dream","dreamer","erase","eraser"]

ans="Yes"
while len(S)>0:
  if S.endswith(W[0]):
    S=S[:-len(W[0])]
  elif S.endswith(W[1]):
    S=S[:-len(W[1])]
  elif S.endswith(W[2]):
    S=S[:-len(W[2])]
  elif S.endswith(W[3]):
    S=S[:-len(W[3])]
  else:
    ans="No"
    break
    
print(ans)

Failing test case input:
p_eedo`btm

Expected output:
NO


Actual output:
No


Fixed program (verdict: Accepted):
S=input()
W=["dream","dreamer","erase","eraser"]

ans="YES"
while len(S)>0:
  if S.endswith(W[0]):
    S=S[:-len(W[0])]
  elif S.endswith(W[1]):
    S=S[:-len(W[1])]
  elif S.endswith(W[2]):
    S=S[:-len(W[2])]
  elif S.endswith(W[3]):
    S=S[:-len(W[3])]
  else:
    ans="NO"
    break
    
print(ans)

Diff:
 S=input()
 W=["dream","dreamer","erase","eraser"]
 
-ans="Yes"
+ans="YES"
 while len(S)>0:
   if S.endswith(W[0]):
     S=S[:-len(W[0])]
   elif S.endswith(W[1]):
     S=S[:-len(W[1])]
   elif S.endswith(W[2]):
     S=S[:-len(W[2])]
   elif S.endswith(W[3]):
     S=S[:-len(W[3])]
   else:
-    ans="No"
+    ans="NO"
     break
     
 print(ans)
Buggy program (verdict: Wrong Answer):
N,X = map(int,input().split())
list = input().split()
list = [int(i) for i in list]

count=0
ans=1

for i in list:
  count += i
  if count > X:
    print(ans)
    exit()
  ans += 1



Failing test case input:
4 9
4 2 0 3

Expected output:
5


Actual output:

Fixed program (verdict: Accepted):
N,X = map(int,input().split())
list = input().split()
list = [int(i) for i in list]

count=0
ans=1

for i in list:
  count += i
  if count > X:
    print(ans)
    exit()
  ans += 1

print(ans)

Diff:
 N,X = map(int,input().split())
 list = input().split()
 list = [int(i) for i in list]
 
 count=0
 ans=1
 
 for i in list:
   count += i
   if count > X:
     print(ans)
     exit()
   ans += 1
 
-
+print(ans)
Buggy program (verdict: Wrong Answer):
from collections import Counter

def solve():
    N = int(input())
    
    counter = Counter(input())
    for _ in range(N-1):
        counter_ = Counter(input())
        counter = {k:min(counter[k],counter_[k]) for k in counter_.keys() & counter.keys()}
        
    print(''.join([k*v for k,v in counter.items()]))
    
solve()

Failing test case input:
3
cbaa
daacc
acacac

Expected output:
aac

Actual output:
caa


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

def solve():
    N = int(input())
    
    counter = Counter(input())
    for _ in range(N-1):
        counter_ = Counter(input())
        counter = {k:min(counter[k],counter_[k]) for k in counter_.keys() & counter.keys()}
        
    print(''.join([k*v for k,v in sorted(counter.items())]))
    
solve()

Diff:
 from collections import Counter
 
 def solve():
     N = int(input())
     
     counter = Counter(input())
     for _ in range(N-1):
         counter_ = Counter(input())
         counter = {k:min(counter[k],counter_[k]) for k in counter_.keys() & counter.keys()}
         
-    print(''.join([k*v for k,v in counter.items()]))
+    print(''.join([k*v for k,v in sorted(counter.items())]))
     
 solve()
Buggy program (verdict: Wrong Answer):
x,a,b=map(int,input().split())
d=a-b
print('dangerous' if x<d else 'delicious' if 0<d else 'safe')

Failing test case input:
0 7 12

Expected output:
dangerous


Actual output:
safe


Fixed program (verdict: Accepted):
x,a,b=map(int,input().split())
print('delicious' if b-a<=0 else 'dangerous' if x<b-a else 'safe')

Diff:
 x,a,b=map(int,input().split())
-d=a-b
-print('dangerous' if x<d else 'delicious' if 0<d else 'safe')
+print('delicious' if b-a<=0 else 'dangerous' if x<b-a else 'safe')
Buggy program (verdict: Wrong Answer):
n=int(input())
s=[0]*n
for i in range(n):
  s[i]=int(input())
s.sort()
ans=sum(s)
temp=0
if ans%10==0:
  for i in range(n):
    if s[i]%10==0:
      temp=temp+1
    else:
      print(ans-s[i])
  if temp==n:
    print(0)
else:
  print(ans)

Failing test case input:
3
1
8
1

Expected output:
9


Actual output:
9
9
2


Fixed program (verdict: Accepted):
n=int(input())
s=[0]*n
for i in range(n):
  s[i]=int(input())
s.sort()
ans=sum(s)
temp=0
if ans%10==0:
  for i in range(n):
    if s[i]%10==0:
      temp=temp+1
    else:
      print(ans-s[i])
      break
  if temp==n:
    print(0)
else:
  print(ans)

Diff:
 n=int(input())
 s=[0]*n
 for i in range(n):
   s[i]=int(input())
 s.sort()
 ans=sum(s)
 temp=0
 if ans%10==0:
   for i in range(n):
     if s[i]%10==0:
       temp=temp+1
     else:
       print(ans-s[i])
+      break
   if temp==n:
     print(0)
 else:
   print(ans)
Buggy program (verdict: Wrong Answer):
data=list(map(int,input().split()))
data.sort()
ans="No"
if data[0]==data[1]:
    if data[1]==data[2]:
        ans="No"
    else:
        ans='Yes'
print(ans)

Failing test case input:
6 5 6

Expected output:
Yes


Actual output:
No


Fixed program (verdict: Accepted):
data=list(map(int,input().split()))
data.sort()

ans="No"
if data[0]==data[1]:
    if data[1]==data[2]:
        ans="No"
    elif data[1]!=data[2]:
        ans='Yes'
elif data[0]!=data[1]:
    if data[1]==data[2]:
        ans="Yes"
print(ans)

Diff:
 data=list(map(int,input().split()))
 data.sort()
+
 ans="No"
 if data[0]==data[1]:
     if data[1]==data[2]:
         ans="No"
-    else:
+    elif data[1]!=data[2]:
         ans='Yes'
+elif data[0]!=data[1]:
+    if data[1]==data[2]:
+        ans="Yes"
 print(ans)
Buggy program (verdict: Wrong Answer):
a = input()
if a[1]==a[2]:
    if a[0] == a[1] or a[2]==a[3]:
        print("Yes")
else: 
    print("No")


Failing test case input:
8004

Expected output:
No


Actual output:

Fixed program (verdict: Accepted):
a = input()
if a[1] == a[2] and (a[0] == a[1] or a[2]==a[3]):
    print("Yes")
else: 
    print("No")


Diff:
 a = input()
-if a[1]==a[2]:
-    if a[0] == a[1] or a[2]==a[3]:
-        print("Yes")
+if a[1] == a[2] and (a[0] == a[1] or a[2]==a[3]):
+    print("Yes")
 else: 
     print("No")
Buggy program (verdict: Wrong Answer):
N = int(input())
member = [0,0,0,0,0]
ans = 0
for _ in range(N):
    a = input().split()
    if a[0] == "M":
        member[0] += 1
    elif a[0] == "A":
        member[1] += 1
    elif a[0] == "R":
        member[2] += 1
    elif a[0] == "C":
        member[3] += 1
    elif a[0] == "H":
        member[4] += 1
 
for i in range(3):
    for j in range(i+1, 4):
        for k in range(j+2, 5):
            ans += member[i]*member[j]*member[k]

print(ans)



Failing test case input:
5
IGDUKO@E
HNR
MTAOKP
AINK
RINGN

Expected output:
4


Actual output:
0


Fixed program (verdict: Accepted):
N = int(input())
member = [0,0,0,0,0]
ans = 0
for _ in range(N):
    a = list(input())
    if a[0] == "M":
        member[0] += 1
    elif a[0] == "A":
        member[1] += 1
    elif a[0] == "R":
        member[2] += 1
    elif a[0] == "C":
        member[3] += 1
    elif a[0] == "H":
        member[4] += 1
 
for i in range(3):
    for j in range(i+1, 4):
        for k in range(j+1, 5):
            ans += member[i]*member[j]*member[k]

print(ans)



Diff:
 N = int(input())
 member = [0,0,0,0,0]
 ans = 0
 for _ in range(N):
-    a = input().split()
+    a = list(input())
     if a[0] == "M":
         member[0] += 1
     elif a[0] == "A":
         member[1] += 1
     elif a[0] == "R":
         member[2] += 1
     elif a[0] == "C":
         member[3] += 1
     elif a[0] == "H":
         member[4] += 1
  
 for i in range(3):
     for j in range(i+1, 4):
-        for k in range(j+2, 5):
+        for k in range(j+1, 5):
             ans += member[i]*member[j]*member[k]
 
 print(ans)
Buggy program (verdict: Wrong Answer):
x = int(input())
while not all(x % i for i in range(2, x)):
    x += 1

Failing test case input:
5560

Expected output:
5563


Actual output:

Fixed program (verdict: Accepted):
x = int(input())
while not all(x % i for i in range(2, x)):
    x += 1
print(x)

Diff:
 x = int(input())
 while not all(x % i for i in range(2, x)):
     x += 1
+print(x)
Buggy program (verdict: Wrong Answer):
n,l = list(map(int,input().split()))
apple = []
for i in range(n):        apple.append(l+i)
print(apple)
if 0 in apple:
        print(sum(apple))
elif n+l < 0:
        print(sum(apple)-apple[len(apple)-1])
else:
        print(sum(apple[1:len(apple)+1]))

Failing test case input:
13 -5

Expected output:
13


Actual output:
[-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
13


Fixed program (verdict: Accepted):
n,l = list(map(int,input().split()))
apple = []
for i in range(n):        apple.append(l+i)
if 0 in apple:
        print(sum(apple))
elif apple[n-1] < 0:
        print(sum(apple)-apple[len(apple)-1])
else:
        print(sum(apple[1:len(apple)+1]))

Diff:
 n,l = list(map(int,input().split()))
 apple = []
 for i in range(n):        apple.append(l+i)
-print(apple)
 if 0 in apple:
         print(sum(apple))
-elif n+l < 0:
+elif apple[n-1] < 0:
         print(sum(apple)-apple[len(apple)-1])
 else:
         print(sum(apple[1:len(apple)+1]))
Buggy program (verdict: Wrong Answer):
S = input()

result='Good'
for i in range(1, len(S)):
    if S[i-1]==S[i]:
        S = 'Bad'
        break
print(result)

Failing test case input:
2155

Expected output:
Bad


Actual output:
Good


Fixed program (verdict: Accepted):
S = input()

result='Good'
for i in range(1, len(S)):
    if S[i-1]==S[i]:
        result = 'Bad'
        break
print(result)

Diff:
 S = input()
 
 result='Good'
 for i in range(1, len(S)):
     if S[i-1]==S[i]:
-        S = 'Bad'
+        result = 'Bad'
         break
 print(result)
Buggy program (verdict: Wrong Answer):
a, b, c = map(int, input().split())

if a == b:
  if b == c:
    print(1)
  else:
    print(2)
elif b == c:
  print(2)
else:
  print(3)

Failing test case input:
4 12 4

Expected output:
2


Actual output:
3


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

if a == b:
  if b == c:
    print(1)
  else:
    print(2)
elif b == c:
  print(2)
elif a == c:
  print(2)
else:
  print(3)


Diff:
 a, b, c = map(int, input().split())
 
 if a == b:
   if b == c:
     print(1)
   else:
     print(2)
 elif b == c:
   print(2)
+elif a == c:
+  print(2)
 else:
   print(3)
+
Buggy program (verdict: Wrong Answer):





















from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7


S1 = input()
S2 = input()

for i in range(len(S2)-1):
	S2 = S2[-1] + S2[:-1]
	if S2 == S1:
		print('Yes')
		sys.exit()

print('No')


Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed program (verdict: Accepted):





















from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7


S1 = input()
S2 = input()

for i in range(len(S2)):
	S2 = S2[-1] + S2[:-1]
	if S2 == S1:
		print('Yes')
		sys.exit()

print('No')


Diff:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 from collections import defaultdict
 import sys,heapq,bisect,math,itertools,string
 sys.setrecursionlimit(10**8)
 INF = float('inf')
 mod = 10**9+7
 
 
 S1 = input()
 S2 = input()
 
-for i in range(len(S2)-1):
+for i in range(len(S2)):
 	S2 = S2[-1] + S2[:-1]
 	if S2 == S1:
 		print('Yes')
 		sys.exit()
 
 print('No')
Buggy program (verdict: Wrong Answer):
a,b = map(int,input().split())

h,w = map(int,input().split())

print(a*b-h*w)


Failing test case input:
7 5
2 2

Expected output:
15


Actual output:
31


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

h,w = map(int,input().split())

print((a-h)*(b-w))


Diff:
 a,b = map(int,input().split())
 
 h,w = map(int,input().split())
 
-print(a*b-h*w)
+print((a-h)*(b-w))
Buggy program (verdict: Wrong Answer):
n,x = map(int,input().split())
l = list(map(int,input().split()))
result = 1
d = 0
for i in range(n):
    d += l[i]
    if d <= x:
        result += 1
    else:
        print(result)
        exit()

Failing test case input:
0 10
22 0 2 17

Expected output:
1


Actual output:

Fixed program (verdict: Accepted):
n,x = map(int,input().split())
l = list(map(int,input().split()))
result = 1
d = 0
for i in range(n):
    d += l[i]
    if d <= x:
        result += 1
    else:
        print(result)
        exit()
print(result)

Diff:
 n,x = map(int,input().split())
 l = list(map(int,input().split()))
 result = 1
 d = 0
 for i in range(n):
     d += l[i]
     if d <= x:
         result += 1
     else:
         print(result)
         exit()
+print(result)
Buggy program (verdict: Wrong Answer):
m = 10**9 + 7
n = input()
a = list(map(int,input().split()))
ans = 0
s = sum(a)

for i in a:
  s -= i
  ans += s*i
  s += i

ans = ans%m

print(ans)

Failing test case input:
4
3646424 4102 178 11813

Expected output:
733190822


Actual output:
466381637


Fixed program (verdict: Accepted):
m = 10**9 + 7
n = input()
a = list(map(int,input().split()))
ans = 0
s = sum(a)

for i in a:
  s -= i
  ans += s*i

ans = ans%m

print(ans)

Diff:
 m = 10**9 + 7
 n = input()
 a = list(map(int,input().split()))
 ans = 0
 s = sum(a)
 
 for i in a:
   s -= i
   ans += s*i
-  s += i
 
 ans = ans%m
 
 print(ans)
Buggy program (verdict: Wrong Answer):
N = int(input())
i = 1 
res =N
flag = True
if N ==1:
  print(0)
else:
  k = int(N**0.5)
  for j in range(1,k+1):
    k = N / j
    b = int(k)
    if k-b == 0:
      res = min(res,i+b-2)
print(res)
  

Failing test case input:
223605823

Expected output:
31934


Actual output:
21568


Fixed program (verdict: Accepted):
N = int(input())
i = 1 
res =N
flag = True
if N ==1:
  print(0)
else:
  k = int(N**0.5)
  for j in range(1,k+1):
    k = N / j
    b = int(k)
    if k-b == 0:
      res = min(res,j+b-2)
print(res)

Diff:
 N = int(input())
 i = 1 
 res =N
 flag = True
 if N ==1:
   print(0)
 else:
   k = int(N**0.5)
   for j in range(1,k+1):
     k = N / j
     b = int(k)
     if k-b == 0:
-      res = min(res,i+b-2)
+      res = min(res,j+b-2)
 print(res)
-
Buggy program (verdict: Wrong Answer):
a,b,c=input().split()
ans="Yes"
if a!=b and b!=c:
  ans="No"
if a==b==c:
  ans="No"

Failing test case input:
1 4 17

Expected output:
No


Actual output:

Fixed program (verdict: Accepted):
a,b,c=input().split()
ans="Yes"
if a!=b and b!=c and c!=a:
  ans="No"
if a==b==c:
  ans="No"
print(ans)

Diff:
 a,b,c=input().split()
 ans="Yes"
-if a!=b and b!=c:
+if a!=b and b!=c and c!=a:
   ans="No"
 if a==b==c:
   ans="No"
+print(ans)
Buggy program (verdict: Wrong Answer):
N = int(input())
member = [0,0,0,0,0]
ans = 0
for _ in range(N):
    a = input().split()
    if a[0] == "M":
        member[0] += 1
    elif a[0] == "A":
        member[1] += 1
    elif a[0] == "R":
        member[2] += 1
    elif a[0] == "C":
        member[3] += 1
    elif a[0] == "H":
        member[4] += 1
 
for i in range(3):
    for j in range(i+1, 4):
        for k in range(j+1, 5):
            ans += member[i]*member[j]*member[k]

print(ans)



Failing test case input:
5
MASHIKE
RUMOI
AOICR
HABOQN
IAN@LOROH

Expected output:
4


Actual output:
0


Fixed program (verdict: Accepted):
N = int(input())
member = [0,0,0,0,0]
ans = 0
for _ in range(N):
    a = list(input())
    if a[0] == "M":
        member[0] += 1
    elif a[0] == "A":
        member[1] += 1
    elif a[0] == "R":
        member[2] += 1
    elif a[0] == "C":
        member[3] += 1
    elif a[0] == "H":
        member[4] += 1
 
for i in range(3):
    for j in range(i+1, 4):
        for k in range(j+1, 5):
            ans += member[i]*member[j]*member[k]

print(ans)



Diff:
 N = int(input())
 member = [0,0,0,0,0]
 ans = 0
 for _ in range(N):
-    a = input().split()
+    a = list(input())
     if a[0] == "M":
         member[0] += 1
     elif a[0] == "A":
         member[1] += 1
     elif a[0] == "R":
         member[2] += 1
     elif a[0] == "C":
         member[3] += 1
     elif a[0] == "H":
         member[4] += 1
  
 for i in range(3):
     for j in range(i+1, 4):
         for k in range(j+1, 5):
             ans += member[i]*member[j]*member[k]
 
 print(ans)
Buggy program (verdict: Wrong Answer):
n,m = list(map(int, input().split()))
if n==1:
  print(m)
else:
  ans = [m]
  for i in range(n-1):
    ans.append(m-(n-i)+1)
    ans.append(m+i+1)
  print(ans)


Failing test case input:
4 59

Expected output:
56 57 58 59 60 61 62


Actual output:
[59, 56, 60, 57, 61, 58, 62]


Fixed program (verdict: Accepted):
n,m = list(map(int, input().split()))
if n==1:
  print(m)
else:
  ans = [m]
  for i in range(n-1):
    ans.append(m-(n-i)+1)
    ans.append(m+i+1)
  ans.sort()
  print(' '.join(map(str, ans)))

Diff:
 n,m = list(map(int, input().split()))
 if n==1:
   print(m)
 else:
   ans = [m]
   for i in range(n-1):
     ans.append(m-(n-i)+1)
     ans.append(m+i+1)
-  print(ans)
-
+  ans.sort()
+  print(' '.join(map(str, ans)))
Buggy program (verdict: Wrong Answer):
n=int(input())
s=input()
l=input()
x=0
for i in range(1,n):
    if s[-i:]==l[:i]:x=i
print(2*n-x)

Failing test case input:
4
expr
expr

Expected output:
4

Actual output:
8


Fixed program (verdict: Accepted):
n=int(input())
s=input()
l=input()
x=0
for i in range(1,n+1):
    if s[-i:]==l[:i]:x=i
print(2*n-x)

Diff:
 n=int(input())
 s=input()
 l=input()
 x=0
-for i in range(1,n):
+for i in range(1,n+1):
     if s[-i:]==l[:i]:x=i
 print(2*n-x)
Buggy program (verdict: Wrong Answer):
import math

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

x, mod = divmod(n, a + b)

if x == 0:
    print(min(a, n))
else:
    print(a * x + mod)

Failing test case input:
96 -7 9

Expected output:
-343


Actual output:
-336


Fixed program (verdict: Accepted):
n, a, b = map(int, input().split())

x, mod = divmod(n, a + b)

if x == 0:
    print(min(a, n))
else:
    print(a * x + min(mod, a))

Diff:
-import math
-
 n, a, b = map(int, input().split())
 
 x, mod = divmod(n, a + b)
 
 if x == 0:
     print(min(a, n))
 else:
-    print(a * x + mod)
+    print(a * x + min(mod, a))
Buggy program (verdict: Wrong Answer):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,K,*H = map(int,read().split())
N -= K
if N <= 0:
    print(0)
    exit()
    
H.sort()
    
print(sum(H[:N - K + 1]))

Failing test case input:
8 5
7 9 5 2 3 8 4 6

Expected output:
9


Actual output:
35


Fixed program (verdict: Accepted):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,K,*H = map(int,read().split())
N -= K
if N <= 0:
    print(0)
    exit()
    
H.sort()
    
print(sum(H[: N]))

Diff:
 import sys
 read = sys.stdin.buffer.read
 readline = sys.stdin.buffer.readline
 readlines = sys.stdin.buffer.readlines
 
 N,K,*H = map(int,read().split())
 N -= K
 if N <= 0:
     print(0)
     exit()
     
 H.sort()
     
-print(sum(H[:N - K + 1]))
+print(sum(H[: N]))
Buggy program (verdict: Wrong Answer):
A, B, C = map(int, input().split())
if 2*(A+B) < C:
    print('No')
else:
    print('Yes')

Failing test case input:
31 36 76

Expected output:
No


Actual output:
Yes


Fixed program (verdict: Accepted):
A, B, C = map(int, input().split())
if A+B < C:
    print('No')
else:
    print('Yes')

Diff:
 A, B, C = map(int, input().split())
-if 2*(A+B) < C:
+if A+B < C:
     print('No')
 else:
     print('Yes')
Buggy program (verdict: Wrong Answer):
from collections import defaultdict
import bisect
N, M = map(int, input().split())
P = [[int(i) for i in input().split()] for _ in range(M)]
D = defaultdict(list)

for p, y in sorted(P):
  D[p] += [y]
  
for p, y in sorted(P):
  z = D[p].index(y)
  print ("%06d%06d"%(p, z+1))


Failing test case input:
2 3
1 32
2 63
1 6

Expected output:
000001000002
000002000001
000001000001


Actual output:
000001000001
000001000002
000002000001


Fixed program (verdict: Accepted):
from collections import defaultdict
import bisect
N, M = map(int, input().split())
P = [[int(i) for i in input().split()] for _ in range(M)]
D = defaultdict(list)

for p, y in sorted(P):
  D[p] += [y]
  
for p, y in P:
  z = bisect.bisect(D[p], y)
  print ("%06d%06d"%(p, z))


Diff:
 from collections import defaultdict
 import bisect
 N, M = map(int, input().split())
 P = [[int(i) for i in input().split()] for _ in range(M)]
 D = defaultdict(list)
 
 for p, y in sorted(P):
   D[p] += [y]
   
-for p, y in sorted(P):
-  z = D[p].index(y)
-  print ("%06d%06d"%(p, z+1))
+for p, y in P:
+  z = bisect.bisect(D[p], y)
+  print ("%06d%06d"%(p, z))
Buggy program (verdict: Wrong Answer):
import math

N = int(input())
h = list(map(int, input().split()))

dp = list([math.inf for i in range(N)])  
dp[0] = 0
for i in range(N):
    a = dp[i]
    b = dp[i - 1] + abs(h[i] - h[i - 1])
    if a > b:
        dp[i] = b
    else:
        dp[i] = a
    if i > 1:
        b2 = dp[i - 2] + abs(h[i] - h[i - 2])
        if a > b2:
            dp[i] = b2
        else:
            dp[i] = a

print(dp[N - 1])


Failing test case input:
6
30 10 60 10 60 57

Expected output:
33


Actual output:
67


Fixed program (verdict: Accepted):
import math

N = int(input())
h = list(map(int, input().split()))

dp = list([math.inf for i in range(N)])  
dp[0] = 0
for i in range(N):
    a = dp[i]
    b = dp[i - 1] + abs(h[i] - h[i - 1])
    if a > b:
        dp[i] = b
    else:
        dp[i] = a
    a = dp[i]
    if i > 1:
        b2 = dp[i - 2] + abs(h[i] - h[i - 2])
        if a > b2:
            dp[i] = b2
        else:
            dp[i] = a

print(dp[N - 1])


Diff:
 import math
 
 N = int(input())
 h = list(map(int, input().split()))
 
 dp = list([math.inf for i in range(N)])  
 dp[0] = 0
 for i in range(N):
     a = dp[i]
     b = dp[i - 1] + abs(h[i] - h[i - 1])
     if a > b:
         dp[i] = b
     else:
         dp[i] = a
+    a = dp[i]
     if i > 1:
         b2 = dp[i - 2] + abs(h[i] - h[i - 2])
         if a > b2:
             dp[i] = b2
         else:
             dp[i] = a
 
 print(dp[N - 1])
Buggy program (verdict: Wrong Answer):
import sys
M, d = input().split()
if int(d)>=10:
  d10 = int(d[0])
  d1 = int(d[1])
else:
  print(0)
  sys.exit()
M = int(M)
ans = 0
for j in range(2,d10+1):
  for i in range(2,10):
    if 10*j+i>d10*10+d1:
      print(ans)
      sys.exit()
    if M >=j*i:
      ans+=1

Failing test case input:
12 39

Expected output:
8


Actual output:

Fixed program (verdict: Accepted):
import sys
M, d = input().split()
if int(d)>=10:
  d10 = int(d[0])
  d1 = int(d[1])
else:
  print(0)
  sys.exit()
M = int(M)
ans = 0
for j in range(2,d10+1):
  for i in range(2,10):
    if 10*j+i>d10*10+d1:
      print(ans)
      sys.exit()
    if M >=j*i:
      ans+=1
print(ans)

Diff:
 import sys
 M, d = input().split()
 if int(d)>=10:
   d10 = int(d[0])
   d1 = int(d[1])
 else:
   print(0)
   sys.exit()
 M = int(M)
 ans = 0
 for j in range(2,d10+1):
   for i in range(2,10):
     if 10*j+i>d10*10+d1:
       print(ans)
       sys.exit()
     if M >=j*i:
       ans+=1
+print(ans)
Buggy program (verdict: Wrong Answer):
n,k = map(int,input().split())
n2 = k
count = 0
while n2 <= n:
  n2*=k
  count+=1
print(n2)
print(count+1)

Failing test case input:
1010101 8

Expected output:
7


Actual output:
2097152
7


Fixed program (verdict: Accepted):
n,k = map(int,input().split())
n2 = k
count = 0
while n2 <= n:
  n2*=k
  count+=1
print(count+1)

Diff:
 n,k = map(int,input().split())
 n2 = k
 count = 0
 while n2 <= n:
   n2*=k
   count+=1
-print(n2)
 print(count+1)
Buggy program (verdict: Wrong Answer):
def p_b():
    n = int(input())
    s = input()
    ans = 0
    for i in range(n - 2):
        if "ABC" == s[i:i + 3]:
            ans += 1
            
p_b()

Failing test case input:
19
RONFUENERFEWORHFIGO

Expected output:
0


Actual output:

Fixed program (verdict: Accepted):
def p_b():
    n = int(input())
    s = input()
    ans = 0
    for i in range(n - 2):
        if "ABC" == s[i:i + 3]:
            ans += 1
    print(ans)
    
p_b()

Diff:
 def p_b():
     n = int(input())
     s = input()
     ans = 0
     for i in range(n - 2):
         if "ABC" == s[i:i + 3]:
             ans += 1
-            
+    print(ans)
+    
 p_b()
Buggy program (verdict: Wrong Answer):





def main():
    N = int(input())
    org = N
    i = 2
    table = []
    while i * i <= N:
        while N % i == 0:
            j = org / i
            N /= i
            table.append(i + j - 2)
        i += 1
    table.append(org - 1)
    print(int(min(table)))


if __name__ == '__main__':
    main()


Failing test case input:
1074356

Expected output:
2143


Actual output:
3523


Fixed program (verdict: Accepted):





def main():
    N = int(input())
    org = N
    i = 2
    table = []
    while i * i <= N:
        if N % i == 0:
            j = org / i
            table.append(i + j - 2)
        i += 1
    table.append(org - 1)
    print(int(min(table)))


if __name__ == '__main__':
    main()


Diff:
 
 
 
 
 
 def main():
     N = int(input())
     org = N
     i = 2
     table = []
     while i * i <= N:
-        while N % i == 0:
+        if N % i == 0:
             j = org / i
-            N /= i
             table.append(i + j - 2)
         i += 1
     table.append(org - 1)
     print(int(min(table)))
 
 
 if __name__ == '__main__':
     main()
Buggy program (verdict: Wrong Answer):
str = input()
S = list(str)
N = len(S)
count = 0
for x in range(N):
    if x % 2 == 0 and S[x] == "0":
        count += 1
    elif x % 2 == 1 and S[x] == "1":
        count += 1
if count >= 50000:
    print(count - 50000)
else:
    print(count)



Failing test case input:
00110101

Expected output:
2


Actual output:
6


Fixed program (verdict: Accepted):
str = input()
S = list(str)
N = len(S)
count = 0
for x in range(N):
    if x % 2 == 0 and S[x] == "0":
        count += 1
    elif x % 2 == 1 and S[x] == "1":
        count += 1
if count > N / 2:
    print(N - count)
else:
    print(count)


Diff:
 str = input()
 S = list(str)
 N = len(S)
 count = 0
 for x in range(N):
     if x % 2 == 0 and S[x] == "0":
         count += 1
     elif x % 2 == 1 and S[x] == "1":
         count += 1
-if count >= 50000:
-    print(count - 50000)
+if count > N / 2:
+    print(N - count)
 else:
     print(count)
 
-
Buggy program (verdict: Wrong Answer):
from collections import defaultdict

N = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)

for i in a:
    d[i] += 1
cnt = 0
ans = 0
for k, v in d.items():
    if v != 1:
        cnt += v - 1
    ans += 1

if cnt == 0:
    print(ans - 2)
elif cnt == 1:
    print(ans - 1)
elif cnt % 2 == 0:
    print(ans)
else:
    print(ans - 1)

Failing test case input:
5
2 -1 -6 25 27

Expected output:
5


Actual output:
3


Fixed program (verdict: Accepted):
from collections import defaultdict

N = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)

for i in a:
    d[i] += 1
cnt = 0
ans = 0
for k, v in d.items():
    if v != 1:
        cnt += v - 1
    ans += 1

if cnt == 0:
    print(ans)
elif cnt == 1:
    print(ans - 1)
elif cnt % 2 == 0:
    print(ans)
else:
    print(ans - 1)

Diff:
 from collections import defaultdict
 
 N = int(input())
 a = list(map(int, input().split()))
 d = defaultdict(int)
 
 for i in a:
     d[i] += 1
 cnt = 0
 ans = 0
 for k, v in d.items():
     if v != 1:
         cnt += v - 1
     ans += 1
 
 if cnt == 0:
-    print(ans - 2)
+    print(ans)
 elif cnt == 1:
     print(ans - 1)
 elif cnt % 2 == 0:
     print(ans)
 else:
     print(ans - 1)
Buggy program (verdict: Wrong Answer):
import itertools
n,m=map(int,input().split())
ab= [list(input()) for _ in range(m)]
ab=list(itertools.chain.from_iterable(ab))
for i in range(1,n+1):
    print(ab.count(i))

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

Expected output:
5
5
0


Actual output:
0
0
0


Fixed program (verdict: Accepted):
import itertools
n,m=map(int,input().split())
ab= [list(map(int,input().split())) for _ in range(m)]
ab=list(itertools.chain.from_iterable(ab))
for i in range(1,n+1):
    print(ab.count(i))

Diff:
 import itertools
 n,m=map(int,input().split())
-ab= [list(input()) for _ in range(m)]
+ab= [list(map(int,input().split())) for _ in range(m)]
 ab=list(itertools.chain.from_iterable(ab))
 for i in range(1,n+1):
     print(ab.count(i))
Buggy program (verdict: Wrong Answer):
def main():
    A, B, C = map(int, input().split())
    N1 = abs(A - B)
    N2 = abs(C)
    if N2 < N1:
        print("No")
    else:
        print("Yes")
main()


Failing test case input:
48 49 10

Expected output:
No


Actual output:
Yes


Fixed program (verdict: Accepted):
def main():
    A, B, C = map(int, input().split())
    if C < min(A, B) or max(A, B) < C:
        print("No")
    else:
        print("Yes")
main()


Diff:
 def main():
     A, B, C = map(int, input().split())
-    N1 = abs(A - B)
-    N2 = abs(C)
-    if N2 < N1:
+    if C < min(A, B) or max(A, B) < C:
         print("No")
     else:
         print("Yes")
 main()
Buggy program (verdict: Wrong Answer):
n,x,y = map(int,input().split())
x -= 1
y -= 1
a = [0] * n
for i in range(n-1):
    for j in range(i+1,n):
        m = min(j-i,abs(i-x)+1+abs(j-y))
        a[m] += 1
for i in range(n):
    print(a[i])


Failing test case input:
34 3 5

Expected output:
34
33
32
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
2
1
0


Actual output:
0
34
33
32
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
2
1
0


Fixed program (verdict: Accepted):
n,x,y = map(int,input().split())
x -= 1
y -= 1
a = [0] * n
for i in range(n-1):
    for j in range(i+1,n):
        m = min(j-i,abs(i-x)+1+abs(j-y))
        a[m] += 1
for i in range(1,n):
    print(a[i])


Diff:
 n,x,y = map(int,input().split())
 x -= 1
 y -= 1
 a = [0] * n
 for i in range(n-1):
     for j in range(i+1,n):
         m = min(j-i,abs(i-x)+1+abs(j-y))
         a[m] += 1
-for i in range(n):
+for i in range(1,n):
     print(a[i])
Buggy program (verdict: Wrong Answer):
h, w = map(int, input().split())
ls = [input().split() for _ in range(h)]

for i in range(h):
	for j in range(w):
		if ls[i][j] == 'snuke':
			print(chr(65 + i) + str(j + 1))
			break

Failing test case input:
15 10
snake smake snake knase sneka snake snake snake snake snake
snake snake ekans snake snake snake rnake ekans ekans snake
snake akeos ekans snake snake elans sneka snake rnake snake
snake snake sn`ke fnask snake snake ekans snake snake snake
ekans snake snake naske ekans ekans snake tnake snake snake
sneka snake snake snake snake snake snake snuke snake snake
rnakd snake snake snake snake snake snbke ekans sneka snake
snake enaks ekans sanje snake sn`ke snake snake snake snake
snake tnake smake snake snake skane snake knase snake snake
knase sneka anske ekans snake snbke snake ekans snake snake
sanke snake snake snake ekbns snake tnake ekans snake snake
snake snake snake snake snake snkaf snake soake snale skane
snake snake snake snake snake snake snbke snake ekans snake
snake snake sndka snake ejans snake snaje sneka ekans snake
snake snake ekans snake sn`ke snake snake snake sneka snake

Expected output:
H6


Actual output:
F8


Fixed program (verdict: Accepted):
h, w = map(int, input().split())
ls = [input().split() for _ in range(h)]

for i in range(h):
	for j in range(w):
		if ls[i][j] == 'snuke':
			print(chr(65 + j) + str(i + 1))
			break

Diff:
 h, w = map(int, input().split())
 ls = [input().split() for _ in range(h)]
 
 for i in range(h):
 	for j in range(w):
 		if ls[i][j] == 'snuke':
-			print(chr(65 + i) + str(j + 1))
+			print(chr(65 + j) + str(i + 1))
 			break
Buggy program (verdict: Wrong Answer):
a, b, c = map(int, input().split())
if (a - b) >= c:
    print(0)
else:
    print(a - b - c)


Failing test case input:
-11 1 3

Expected output:
15


Actual output:
-15


Fixed program (verdict: Accepted):
a, b, c = map(int, input().split())
if (a - b) >= c:
    print(0)
else:
    print(c - (a - b))


Diff:
 a, b, c = map(int, input().split())
 if (a - b) >= c:
     print(0)
 else:
-    print(a - b - c)
+    print(c - (a - b))
Buggy program (verdict: Wrong Answer):
a, b = map(int, input().split())

if int(a / 0.08 * 0.1) == b:
  print(int(a / 0.08 * 0.1))
elif int(b / 0.1 * 0.08) == a:
  print(int(b / 0.1 * 0.08))
else:
  print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
10


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

if int(a / 0.08 * 0.1) == b:
    print(round(a / 0.08 + 0.0001))
elif int(b / 0.1 * 0.08) == a:
    print(round(b / 0.1 + 0.0001))
else:
    print(-1)


Diff:
 a, b = map(int, input().split())
 
 if int(a / 0.08 * 0.1) == b:
-  print(int(a / 0.08 * 0.1))
+    print(round(a / 0.08 + 0.0001))
 elif int(b / 0.1 * 0.08) == a:
-  print(int(b / 0.1 * 0.08))
+    print(round(b / 0.1 + 0.0001))
 else:
-  print(-1)
+    print(-1)
+
Buggy program (verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
ans=0
suma=sum(a)
for i in range(n):
  ans+=(a[i]*(suma-a[i]))
  ans/=2
print(int(ans%(10**9+7)))

Failing test case input:
4
1988253 116846 9743 12204

Expected output:
638919417


Actual output:
669689782


Fixed program (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
ans=0
suma=sum(a)
for i in range(n):
  suma-=a[i]
  ans+=(a[i]*(suma))%(10**9+7)
print(int(ans%(10**9+7)))


Diff:
 n=int(input())
 a=list(map(int,input().split()))
 ans=0
 suma=sum(a)
 for i in range(n):
-  ans+=(a[i]*(suma-a[i]))
-  ans/=2
+  suma-=a[i]
+  ans+=(a[i]*(suma))%(10**9+7)
 print(int(ans%(10**9+7)))
+
Buggy program (verdict: Wrong Answer):

a = list(map(int, input().split()))

num = len(a) - 1
minv = a[0]
maxv = -2000000000

for i in range(num):
    if minv > a[i]:
        minv = a[i]
    if a[i] - minv > maxv:
        maxv = a[i] - minv

print(maxv)


Failing test case input:
3
-42
0
2

Expected output:
44


Actual output:
-2000000000


Fixed program (verdict: Accepted):


nums = int(input())
a = [int(input()) for i in range(nums)]

minv = a[0]
maxv = -2000000000

for i in range(1, nums):
    maxv = max(maxv, a[i] - minv)
    minv = min(minv, a[i])

print(maxv)



Diff:
 
-a = list(map(int, input().split()))
 
-num = len(a) - 1
+nums = int(input())
+a = [int(input()) for i in range(nums)]
+
 minv = a[0]
 maxv = -2000000000
 
-for i in range(num):
-    if minv > a[i]:
-        minv = a[i]
-    if a[i] - minv > maxv:
-        maxv = a[i] - minv
+for i in range(1, nums):
+    maxv = max(maxv, a[i] - minv)
+    minv = min(minv, a[i])
 
 print(maxv)
 
+
Buggy program (verdict: Wrong Answer):
n,m,x = map(int,input().split())
li = list(map(int,input().split()))
if x < li[0] or x > li[m-1] :
    print(0)
else :
    for i in range(m-1) :
        print(min(i+1,m-i-1))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
1
1


Fixed program (verdict: Accepted):
n,m,x = map(int,input().split())
li = list(map(int,input().split()))
if x < li[0] or x > li[m-1] :
    print(0)
else :
    for i in range(m-1) :
        if x > li[i] and x < li[i+1] :
            print(min(i+1,m-i-1))


Diff:
 n,m,x = map(int,input().split())
 li = list(map(int,input().split()))
 if x < li[0] or x > li[m-1] :
     print(0)
 else :
     for i in range(m-1) :
-        print(min(i+1,m-i-1))
+        if x > li[i] and x < li[i+1] :
+            print(min(i+1,m-i-1))
Buggy program (verdict: Wrong Answer):
n = int(input())
lst = []

for i in range(n):
  a, b = input().split()
  b = int(b)
  lst.append([a, b])
x = input()
sum_time = 0
flag = False
for i in lst:
  if i[0] == x:
    flag = True
  if flag:
    sum_time += i[1]
print(sum_time)


Failing test case input:
15
ynpxn 279
jgjfwx 127
qquhuwq 319
rxing 549
pmuduhznoaqu 832
dagktgdarveusju 595
iunfagppcow 200
dhavrncwfw 720
ggimcpj 658
wrczqxycivdqn 19
mcmkkbnjfeod 992
zstythbkgkwqth 130
twflegsjz 809
dswzxrxuzxfhkp 989
szfwtzfpnscgue 958
pmuduhznoaqu

Expected output:
6070


Actual output:
6902


Fixed program (verdict: Accepted):
n = int(input())
lst = []

for i in range(n):
  a, b = input().split()
  b = int(b)
  lst.append([a, b])
x = input()
sum_time = 0
flag = False
for i in lst:
  if flag:
    sum_time += i[1]
  if i[0] == x:
    flag = True
print(sum_time)


Diff:
 n = int(input())
 lst = []
 
 for i in range(n):
   a, b = input().split()
   b = int(b)
   lst.append([a, b])
 x = input()
 sum_time = 0
 flag = False
 for i in lst:
-  if i[0] == x:
-    flag = True
   if flag:
     sum_time += i[1]
+  if i[0] == x:
+    flag = True
 print(sum_time)
Buggy program (verdict: Wrong Answer):
a = int(input())
b = int(input())

List = {a, b}

if List == {1, 2}:
  print(3)
if List == {2, 3}:
  print(1)
if List == {3, 1}:
  print(1)



Failing test case input:
3
001

Expected output:
2


Actual output:
1


Fixed program (verdict: Accepted):
a = int(input())
b = int(input())

List = {a, b}

if List == {1, 2}:
  print(3)
if List == {2, 3}:
  print(1)
if List == {3, 1}:
  print(2)

Diff:
 a = int(input())
 b = int(input())
 
 List = {a, b}
 
 if List == {1, 2}:
   print(3)
 if List == {2, 3}:
   print(1)
 if List == {3, 1}:
-  print(1)
-
-
+  print(2)