ZhenlongDai/ACPR huggingface dataset:
Buggy program (verdict: Wrong Answer):
a = list(map(int, input().split()))

a.sort()
if a[0] == a[2] or a[0] < a[1] < a[2]:
  print('Yes')
else:
  print('No')

Failing test case input:
0 2 1

Expected output:
No


Actual output:
Yes


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

a.sort()
if a[0] == a[2] or a[0] < a[1] < a[2]:
  print('No')
else:
  print('Yes')

Diff:
 a = list(map(int, input().split()))
 
 a.sort()
 if a[0] == a[2] or a[0] < a[1] < a[2]:
-  print('Yes')
-else:
   print('No')
+else:
+  print('Yes')
Buggy program (verdict: Wrong Answer):
from bisect import bisect_right

n = int(input())
a = sorted(map(int, input().split()))
r = 0
for i in range(2, n):
    j = i - 1
    while j >=0 and a[j - 1] + a[j] > a[i]:
        r += j - bisect_right(a, i - j, 0, j)
        j -= 1
print(r)


Failing test case input:
7
540 1452 60 24 75 304 3

Expected output:
1


Actual output:
2


Fixed program (verdict: Accepted):
from bisect import bisect_right

n = int(input())
a = sorted(map(int, input().split()))
r = 0
for i in range(2, n):
    j = i - 1
    while j and a[j - 1] + a[j] > a[i]:
        r += j - bisect_right(a, a[i] - a[j], 0, j)
        j -= 1
print(r)


Diff:
 from bisect import bisect_right
 
 n = int(input())
 a = sorted(map(int, input().split()))
 r = 0
 for i in range(2, n):
     j = i - 1
-    while j >=0 and a[j - 1] + a[j] > a[i]:
-        r += j - bisect_right(a, i - j, 0, j)
+    while j and a[j - 1] + a[j] > a[i]:
+        r += j - bisect_right(a, a[i] - a[j], 0, j)
         j -= 1
 print(r)
Buggy program (verdict: Wrong Answer):
import sys

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

loop = 0

while (1):
  for i in l:
    if (i % (2 ** loop) != 0):
      print(loop)
      sys.exit(0)
  loop = loop + 1

Failing test case input:
6
348324507 1154626501 32183854 379425024 590201381 471526144

Expected output:
0


Actual output:
1


Fixed program (verdict: Accepted):
import sys

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

loop = 0

while (1):
  for i in l:
    if i % (2 ** (loop + 1)) != 0:
      print(loop)
      sys.exit(0)
  loop = loop + 1


Diff:
 import sys
 
 n = input()
 l = list(map(int, input().split()))
 
 loop = 0
 
 while (1):
   for i in l:
-    if (i % (2 ** loop) != 0):
+    if i % (2 ** (loop + 1)) != 0:
       print(loop)
       sys.exit(0)
   loop = loop + 1
+
Buggy program (verdict: Wrong Answer):
m = int(input())
n = [int(input())for i in range(m)]

minv = n[0]
maxv = -99999999999

for i in range(m):
    maxv = max(maxv, (n[i]-minv))
    minv = min(minv, n[i])

print(maxv)

Failing test case input:
3
1
-4
-24

Expected output:
-5


Actual output:
0


Fixed program (verdict: Accepted):
m = int(input())
n = [int(input())for i in range(m)]

minv = n[0]
maxv = -99999999999

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

print(maxv)

Diff:
 m = int(input())
 n = [int(input())for i in range(m)]
 
 minv = n[0]
 maxv = -99999999999
 
-for i in range(m):
+for i in range(1,m):
     maxv = max(maxv, (n[i]-minv))
     minv = min(minv, n[i])
 
 print(maxv)
Buggy program (verdict: Wrong Answer):
k,n=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for x in range(n-1):
  b=a[x+1]-a[x]
  ans=max(ans,b)
  
c=k-a[n-1]+a[0]

print(max(ans,c))



Failing test case input:
27 3
1 6 41

Expected output:
-8


Actual output:
35


Fixed program (verdict: Accepted):
k,n=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for x in range(n-1):
  b=a[x+1]-a[x]
  ans=max(ans,b)
  
c=k-a[n-1]+a[0]

print(k-max(ans,c))



Diff:
 k,n=map(int,input().split())
 a=list(map(int,input().split()))
 ans=0
 for x in range(n-1):
   b=a[x+1]-a[x]
   ans=max(ans,b)
   
 c=k-a[n-1]+a[0]
 
-print(max(ans,c))
+print(k-max(ans,c))
Buggy program (verdict: Wrong Answer):
h,w=map(int,input().split())
s=[list(input().split()) for _ in range(h)]
for i in range(h):
  for j in range(w):
    if s[i][j]=='snuke':
      print(chr(ord('A')+j) +str(i))
      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:
H5


Fixed program (verdict: Accepted):
h,w=map(int,input().split())
s=[list(input().split()) for _ in range(h)]
for i in range(h):
  for j in range(w):
    if s[i][j]=='snuke':
      print(chr(ord('A')+j)+str(i+1))
      break

Diff:
 h,w=map(int,input().split())
 s=[list(input().split()) for _ in range(h)]
 for i in range(h):
   for j in range(w):
     if s[i][j]=='snuke':
-      print(chr(ord('A')+j) +str(i))
+      print(chr(ord('A')+j)+str(i+1))
       break
Buggy program (verdict: Wrong Answer):
a=int(input())
ans=0
for i in range(a):
  if not i%3==0 and not i%5==0:
    ans+=i
print(ans)

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed program (verdict: Accepted):
a=int(input())
ans=0
for i in range(1,a+1):
  if not i%3==0 and not i%5==0:
    ans+=i
print(ans)

Diff:
 a=int(input())
 ans=0
-for i in range(a):
+for i in range(1,a+1):
   if not i%3==0 and not i%5==0:
     ans+=i
 print(ans)
Buggy program (verdict: Wrong Answer):
N = int(input())
V = input().split()
C = input().split()
cost = []
x = 0
for i in range(N):
    cost.append(int(V[int(i)]) - int(C[int(i)]))
print(cost)
print(sorted(cost,reverse=True))
for i in range(N):
    if cost[i] > 0:
        x = x + int(cost[i])
print(x)

Failing test case input:
3
10 1 5
12 5 1

Expected output:
4


Actual output:
[-2, -4, 4]
[4, -2, -4]
4


Fixed program (verdict: Accepted):
N = int(input())
V = input().split()
C = input().split()
cost = []
x = 0
for i in range(N):
    cost.append(int(V[int(i)]) - int(C[int(i)]))
for i in range(N):
    if cost[i] > 0:
        x = x + int(cost[i])
print(x)

Diff:
 N = int(input())
 V = input().split()
 C = input().split()
 cost = []
 x = 0
 for i in range(N):
     cost.append(int(V[int(i)]) - int(C[int(i)]))
-print(cost)
-print(sorted(cost,reverse=True))
 for i in range(N):
     if cost[i] > 0:
         x = x + int(cost[i])
 print(x)
Buggy program (verdict: Wrong Answer):
N = int(input())

ST = list()

for i in range(N):
    s, t = input().split()
    ST.append([s, t])

X = input()

result = None

for s, t in ST:
    t = int(t)
    if result is None:
        if s == X:
            result = 0
    else:
        result += t
    print(s, t)

print(result)

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

Expected output:
7616


Actual output:
ypnxn 279
jgjfwx 127
qquhuwq 319
rxing 549
pmuduhznoaqu 832
dagktgdarveusju 595
iunfagppcow 200
dhavrncwfw 720
ggimcpj 658
wrczqxycivdqn 639
mcmkkbnjfeod 992
zstythbkgkvqth 130
twflegsjz 809
dswzxrxuzxfhkp 989
szfwtzfpnscgue 1884
7616


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

ST = list()

for i in range(N):
    s, t = input().split()
    ST.append([s, t])

X = input()

result = None

for s, t in ST:
    t = int(t)
    if result is None:
        if s == X:
            result = 0
    else:
        result += t

print(result)

Diff:
 N = int(input())
 
 ST = list()
 
 for i in range(N):
     s, t = input().split()
     ST.append([s, t])
 
 X = input()
 
 result = None
 
 for s, t in ST:
     t = int(t)
     if result is None:
         if s == X:
             result = 0
     else:
         result += t
-    print(s, t)
 
 print(result)
Buggy program (verdict: Wrong Answer):
s=list(input())
for i in range(0,len(s)-1):
    if s[i]==s[i+1]:
        print('Bad')
    else:
        print('Good')


Failing test case input:
9991

Expected output:
Bad


Actual output:
Bad
Bad
Good


Fixed program (verdict: Accepted):
s=list(input())
for i in range(0,len(s)-1):
    if s[i]==s[i+1]:
        print('Bad')
        break
else:
    print('Good')


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

c = b + a - 1
d = b - a + 1

n_list = []

if c == d:
    print(c)
elif c != d:
    max_n = max(c,d)
    min_n = min(c,d)
    for i in range(min_n, max_n+1):
        n_list.append(i)

print(n_list)

Failing test case input:
9 35

Expected output:
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43


Actual output:
[27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43]


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

c = b + a - 1
d = b - a + 1

n_list = []

if c == d:
    print(c)
elif c != d:
    max_n = max(c,d)
    min_n = min(c,d)
    for i in range(min_n, max_n+1):
        n_list.append(i)
    


print( " ".join( repr(e) for e in n_list ) )

Diff:
 a,b=map(int, input().split())
 
 c = b + a - 1
 d = b - a + 1
 
 n_list = []
 
 if c == d:
     print(c)
 elif c != d:
     max_n = max(c,d)
     min_n = min(c,d)
     for i in range(min_n, max_n+1):
         n_list.append(i)
+    
 
-print(n_list)
+
+print( " ".join( repr(e) for e in n_list ) )
Buggy program (verdict: Wrong Answer):
n = input()

for i in range(9):
    if int(str(i)*3) >= int(n):
        print(str(i)*3)
        exit()

Failing test case input:
985

Expected output:
999


Actual output:

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

for i in range(10):
    if int(str(i)*3) >= int(n):
        print(str(i)*3)
        exit()

Diff:
 n = input()
 
-for i in range(9):
+for i in range(10):
     if int(str(i)*3) >= int(n):
         print(str(i)*3)
         exit()
Buggy program (verdict: Wrong Answer):
import math
A,B,N = map(int, input().split())

def calc(x):
    y = math.floor(A * x / B) - A * math.floor(x / B)
    return y

max_v = 0

if N < B:
    max_v = calc(N)
else:
    max_v = calc(B)





print(max_v)


Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed program (verdict: Accepted):
import math
A,B,N = map(int, input().split())

def calc(x):
    y = math.floor(A * x / B) - A * math.floor(x / B)
    return y

max_v = 0

if N < B:
    max_v = calc(N)
else:
    max_v = calc(B-1)





print(max_v)


Diff:
 import math
 A,B,N = map(int, input().split())
 
 def calc(x):
     y = math.floor(A * x / B) - A * math.floor(x / B)
     return y
 
 max_v = 0
 
 if N < B:
     max_v = calc(N)
 else:
-    max_v = calc(B)
+    max_v = calc(B-1)
 
 
 
 
 
 print(max_v)
Buggy program (verdict: Wrong Answer):
a, b = map(int, input().split())
count = 0
ans = 0
for i in range(1, 101):
    if int(i*0.08) == a and int(i*0.1) == b:
        count = 1
        ans = i
        break
    else:
        pass
print(ans if count == 1 else "-1")

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed program (verdict: Accepted):
a, b = map(int, input().split())
count = 0
ans = 0
for i in range(1, 1001):
    if int(i*0.08) == a and int(i*0.1) == b:
        count = 1
        ans = i
        break
    else:
        pass
print(ans if count == 1 else "-1")

Diff:
 a, b = map(int, input().split())
 count = 0
 ans = 0
-for i in range(1, 101):
+for i in range(1, 1001):
     if int(i*0.08) == a and int(i*0.1) == b:
         count = 1
         ans = i
         break
     else:
         pass
 print(ans if count == 1 else "-1")
Buggy program (verdict: Wrong Answer):
def main():
    N = [int(x) for x in input()]
    dp0 = 0
    dp1 = 1
    for n in N:
        
        a = min(dp0 + n, dp1 + 10 - n)
        
        b = min(dp0 + n + 1, dp1 + 10 - (n+1))
        dp0, dp1 = a, b
        print(n, dp0, dp1)
    print(dp0)


if __name__ == '__main__':
    main()

Failing test case input:
239818233088120884498468411043636524061804551883788236263668790700484152911743168866

Expected output:
207


Actual output:
2 2 3
3 5 6
9 7 6
8 8 7
1 9 10
8 12 11
2 14 15
3 17 18
3 20 21
0 20 21
8 23 22
8 24 23
1 25 26
2 27 28
0 27 28
8 30 29
8 31 30
4 35 35
4 39 40
9 41 40
8 42 41
4 46 46
6 50 49
8 51 50
4 55 55
1 56 57
1 57 58
0 57 58
4 61 62
3 64 65
6 69 68
3 72 73
6 77 76
5 81 80
2 83 84
4 87 88
0 87 88
6 92 91
1 93 94
8 96 95
0 96 97
4 100 101
5 105 105
5 110 109
1 111 112
8 114 113
8 115 114
3 118 119
7 122 121
8 123 122
8 124 123
2 126 127
3 129 130
6 134 133
2 136 137
6 141 140
3 144 145
6 149 148
6 152 151
8 153 152
7 155 154
9 155 154
0 155 156
7 159 158
0 159 160
0 159 160
4 163 164
8 166 165
4 170 170
1 171 172
5 176 176
2 178 179
9 180 179
1 181 182
1 182 183
7 186 185
4 190 190
3 193 194
1 194 195
6 199 198
8 200 199
8 201 200
6 204 203
6 207 206
207


Fixed program (verdict: Accepted):
def main():
    N = [int(x) for x in input()]
    dp0 = 0
    dp1 = 1
    for n in N:
        
        a = min(dp0 + n, dp1 + 10 - n)
        
        b = min(dp0 + n + 1, dp1 + 10 - (n+1))
        dp0, dp1 = a, b
        
    print(dp0)
 
 
if __name__ == '__main__':
    main()

Diff:
 def main():
     N = [int(x) for x in input()]
     dp0 = 0
     dp1 = 1
     for n in N:
         
         a = min(dp0 + n, dp1 + 10 - n)
         
         b = min(dp0 + n + 1, dp1 + 10 - (n+1))
         dp0, dp1 = a, b
-        print(n, dp0, dp1)
+        
     print(dp0)
-
-
+ 
+ 
 if __name__ == '__main__':
     main()
Buggy program (verdict: Wrong Answer):

import decimal
a,b = map(int,input().split())

for i in range(1,10001):
    num1 = int(i*decimal.Decimal("0.08"))
    num2 = int(i*decimal.Decimal("0.1"))
    if num1 == a and num2 == b:
        print(i)
        break
    if i*decimal.Decimal("0.08") > a:
        print("-1")
        break

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed program (verdict: Accepted):

import decimal
a,b = map(int,input().split())

for i in range(1,10001):
    num1 = int(i*decimal.Decimal("0.08"))
    num2 = int(i*decimal.Decimal("0.1"))
    if num1 == a and num2 == b:
        print(i)
        break
    if int(i*decimal.Decimal("0.08")) > a:
        print("-1")
        break

Diff:
 
 import decimal
 a,b = map(int,input().split())
 
 for i in range(1,10001):
     num1 = int(i*decimal.Decimal("0.08"))
     num2 = int(i*decimal.Decimal("0.1"))
     if num1 == a and num2 == b:
         print(i)
         break
-    if i*decimal.Decimal("0.08") > a:
+    if int(i*decimal.Decimal("0.08")) > a:
         print("-1")
         break
Buggy program (verdict: Wrong Answer):
A,B,C = map(int, input().split())

A,C = C,A

print(A,B,C)

Failing test case input:
010 000 100

Expected output:
100 10 0


Actual output:
100 0 10


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

A,B = B,A
A,C = C,A

print(A,B,C)

Diff:
 A,B,C = map(int, input().split())
 
+A,B = B,A
 A,C = C,A
 
 print(A,B,C)
Buggy program (verdict: Wrong Answer):
n=int(input())
a=[int(input()) for _ in range(n)]

cnt=0
push=1
for i in range(n):
    push=a[push-1]
    cnt+=1
    if push == 2:
        print(cnt+1)
        exit()
print(-1)





Failing test case input:
4
4
5
0
2

Expected output:
2


Actual output:
3


Fixed program (verdict: Accepted):
n=int(input())
a=[int(input()) for _ in range(n)]
cnt=0
push=1
for i in range(n):
    push=a[push-1]
    cnt+=1
    if push == 2:
        print(cnt)
        exit()
print(-1)


Diff:
 n=int(input())
 a=[int(input()) for _ in range(n)]
-
 cnt=0
 push=1
 for i in range(n):
     push=a[push-1]
     cnt+=1
     if push == 2:
-        print(cnt+1)
+        print(cnt)
         exit()
 print(-1)
 
-
-
-
Buggy program (verdict: Wrong Answer):
n=int(input())
l=[[0]*9]*9
for  i in range(1,n):
  if i%10:
    l[int(str(i)[0])-1][int(str(i)[-1])-1]+=1
ans=0
for i in range(9):
  for j in range(9):
    ans+=l[i][j]*l[j][i]
print(ans)

Failing test case input:
897

Expected output:
8083


Actual output:
651249


Fixed program (verdict: Accepted):
n=int(input())
l=[[0 for i in range(10)]for s in range(10)]
for  i in range(n+1):
  if i%10:
    l[int(str(i)[0])-1][int(str(i)[-1])-1]+=1
ans=0
for i in range(9):
  for j in range(9):
    ans+=l[i][j]*l[j][i]
print(ans)


Diff:
 n=int(input())
-l=[[0]*9]*9
-for  i in range(1,n):
+l=[[0 for i in range(10)]for s in range(10)]
+for  i in range(n+1):
   if i%10:
     l[int(str(i)[0])-1][int(str(i)[-1])-1]+=1
 ans=0
 for i in range(9):
   for j in range(9):
     ans+=l[i][j]*l[j][i]
 print(ans)
+
Buggy program (verdict: Wrong Answer):
n,m = map(int,input().split())
broken = [True] * (n+1)
for _ in range(m):
    broken[int(input())] = False

mod = 10 ** 9 + 7

dp = [0] * (n+1)
dp[-1] = 1
if broken[n-1]:
    dp[n-1] = 1

for i in reversed(range(n-1)):
    if broken[i]:
        dp[i] = dp[i+1] + dp[i+2] % mod
        
print(dp[0])

Failing test case input:
100 0
1
23
45
47
89

Expected output:
782204094


Actual output:
29782204297


Fixed program (verdict: Accepted):
n,m = map(int,input().split())
broken = [True] * (n+1)
for _ in range(m):
    broken[int(input())] = False

mod = 10 ** 9 + 7

dp = [0] * (n+1)
dp[-1] = 1
if broken[n-1]:
    dp[n-1] = 1

for i in reversed(range(n-1)):
    if broken[i]:
        dp[i] = (dp[i+1] + dp[i+2]) % mod
        
print(dp[0])

Diff:
 n,m = map(int,input().split())
 broken = [True] * (n+1)
 for _ in range(m):
     broken[int(input())] = False
 
 mod = 10 ** 9 + 7
 
 dp = [0] * (n+1)
 dp[-1] = 1
 if broken[n-1]:
     dp[n-1] = 1
 
 for i in reversed(range(n-1)):
     if broken[i]:
-        dp[i] = dp[i+1] + dp[i+2] % mod
+        dp[i] = (dp[i+1] + dp[i+2]) % mod
         
 print(dp[0])
Buggy program (verdict: Wrong Answer):
A, B, K = map(int, input().split())

if A>K:
    A=A-K
    B=B
    print(A,B)
elif A<K:
    print(0,B-(K-A))

elif A<K and K-A>B:
    print(0,0)

Failing test case input:
8901212864 933260677 1110110100001

Expected output:
0 0


Actual output:
0 -1100275626460


Fixed program (verdict: Accepted):
A, B, K = map(int, input().split())

if A>=K:
    A=A-K
    B=B
    print(A,B)
elif A<K and K-A<B:
    print(0,B-(K-A))

elif A<K and K-A>B:
    print(0,0)
else:
    print(0,0)

Diff:
 A, B, K = map(int, input().split())
 
-if A>K:
+if A>=K:
     A=A-K
     B=B
     print(A,B)
-elif A<K:
+elif A<K and K-A<B:
     print(0,B-(K-A))
 
 elif A<K and K-A>B:
     print(0,0)
+else:
+    print(0,0)
Buggy program (verdict: Wrong Answer):
N = int(input())
sum = 0
for i in range(N):
    if (i%3)*(i%5):
        sum += i

print(sum)

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed program (verdict: Accepted):
N = int(input())
sum = 0
for i in range(1, N+1):
    if (i%3)*(i%5):
        sum += i

print(sum)

Diff:
 N = int(input())
 sum = 0
-for i in range(N):
+for i in range(1, N+1):
     if (i%3)*(i%5):
         sum += i
 
 print(sum)
Buggy program (verdict: Wrong Answer):
def main():
    _len = int(input())
    _str = input()

    if _len > 0 or _len < 100 or _len % 2 : 
        print("No")
        return

    print(_len/2)
    a, b = _str[:_len/2], _str[_len/2:]

    print("Yes" if a == b else "No")


if __name__ == '__main__':
    main()

Failing test case input:
6
abcabc

Expected output:
Yes

Actual output:
No


Fixed program (verdict: Accepted):

def main():
    _len = int(input())
    _str = input()

    if _len < 0 or _len > 100 or _len % 2 : 
        print("No")
        return
    idx = int(_len/2)
    a, b = _str[:idx], _str[idx:]

    print("Yes" if a == b else "No")


if __name__ == '__main__':
    main()

Diff:
+
 def main():
     _len = int(input())
     _str = input()
 
-    if _len > 0 or _len < 100 or _len % 2 : 
+    if _len < 0 or _len > 100 or _len % 2 : 
         print("No")
         return
-
-    print(_len/2)
-    a, b = _str[:_len/2], _str[_len/2:]
+    idx = int(_len/2)
+    a, b = _str[:idx], _str[idx:]
 
     print("Yes" if a == b else "No")
 
 
 if __name__ == '__main__':
     main()
Buggy program (verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(N,2*N):
    ans += a[i] 
print(ans)

Failing test case input:
2
0 -1 26 4 3 0

Expected output:
4


Actual output:
3


Fixed program (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(N,3*N,2):
    ans += a[i] 
print(ans)

Diff:
 N = int(input())
 a = list(map(int, input().split()))
 a.sort()
 ans = 0
-for i in range(N,2*N):
+for i in range(N,3*N,2):
     ans += a[i] 
 print(ans)
Buggy program (verdict: Wrong Answer):
n = input()
a = 0
b = 0
for s in n:
  v = int(s)
  a_ = min(a + v, b + v)
  b_ = min(a + 10 - v + 1, b + 10 - v + 1 - 2)
  a = a_
  b = b_
  
print(min(a, b))

Failing test case input:
55281069069669140036096567167987803917949900262269041019580432304146529155237957819637499367

Expected output:
204


Actual output:
202


Fixed program (verdict: Accepted):
n = input()
a = 0
b = 2
for s in n:
  v = int(s)
  a_ = min(a + v, b + v)
  b_ = min(a + 10 - v + 1, b + 10 - v + 1 - 2)
  a = a_
  b = b_
  
print(min(a, b))

Diff:
 n = input()
 a = 0
-b = 0
+b = 2
 for s in n:
   v = int(s)
   a_ = min(a + v, b + v)
   b_ = min(a + 10 - v + 1, b + 10 - v + 1 - 2)
   a = a_
   b = b_
   
 print(min(a, b))
Buggy program (verdict: Wrong Answer):
n,m = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
a = 0
b = 0
Mod = 10**9 + 7

for k in range(1,n+1):
    a += (k-1)*x[k-1] - (n-k)*x[k-1]
for j in range(1,m+1):
    b += (j-1)*y[j-1] - (m-j)*y[j-1]

res = a*b
print(a*b)

Failing test case input:
6 5
-983443749 -427981748 95834122 371122782 666143127 802780784
-253230108 54513325 556319375 712662868 735867677

Expected output:
224630636


Actual output:
65849499613171124700


Fixed program (verdict: Accepted):
n,m = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
a = 0
b = 0
Mod = 10**9 + 7

for k in range(1,n+1):
    a += (k-1)*x[k-1] - (n-k)*x[k-1]
for j in range(1,m+1):
    b += (j-1)*y[j-1] - (m-j)*y[j-1]

res = a*b
print(a*b%Mod)

Diff:
 n,m = list(map(int,input().split()))
 x = list(map(int,input().split()))
 y = list(map(int,input().split()))
 a = 0
 b = 0
 Mod = 10**9 + 7
 
 for k in range(1,n+1):
     a += (k-1)*x[k-1] - (n-k)*x[k-1]
 for j in range(1,m+1):
     b += (j-1)*y[j-1] - (m-j)*y[j-1]
 
 res = a*b
-print(a*b)
+print(a*b%Mod)
Buggy program (verdict: Wrong Answer):
s=input()
makeban=0
for i in s:
    if i=="o":
        makeban+=1
if makeban<=8:
    print("YES")
else:
    print("NO")

Failing test case input:
xxxxxxxx

Expected output:
NO

Actual output:
YES


Fixed program (verdict: Accepted):
s=input()
makeban=0
for i in s:
    if i=="x":
        makeban+=1
if makeban<=7:
    print("YES")
else:
    print("NO")

Diff:
 s=input()
 makeban=0
 for i in s:
-    if i=="o":
+    if i=="x":
         makeban+=1
-if makeban<=8:
+if makeban<=7:
     print("YES")
 else:
     print("NO")
Buggy program (verdict: Wrong Answer):
line = input().split()
count = 0
if line.count(line[0])==3:
    print(1)
if line.count(line[0])==2:
    print(2)
if line.count(line[0])==1 and line.count(line[1])==1:
    print(3)
elif line.count(line[1])==2:
    print(2)


Failing test case input:
3 3 33

Expected output:
2

Actual output:
2
2


Fixed program (verdict: Accepted):
line = input().split()
count = 0
if line.count(line[0])==3:
    print(1)
elif line.count(line[1])==2 or line.count(line[0])==2:
    print(2)
else:
    print(3)


Diff:
 line = input().split()
 count = 0
 if line.count(line[0])==3:
     print(1)
-if line.count(line[0])==2:
+elif line.count(line[1])==2 or line.count(line[0])==2:
     print(2)
-if line.count(line[0])==1 and line.count(line[1])==1:
+else:
     print(3)
-elif line.count(line[1])==2:
-    print(2)
Buggy program (verdict: Wrong Answer):
def checker(s):
    for i,v in enumerate(s[1:]):
        if s[i-1] == s[i]:
            return("Bad")
    return("Good")
s = input()

print(checker(s))

Failing test case input:
1722

Expected output:
Bad


Actual output:
Good


Fixed program (verdict: Accepted):
def checker(s):
    for i,v in enumerate(s[:-1]):
        if s[i] == s[i+1]:
            return("Bad")
    return("Good")
s = input()

print(checker(s))

Diff:
 def checker(s):
-    for i,v in enumerate(s[1:]):
-        if s[i-1] == s[i]:
+    for i,v in enumerate(s[:-1]):
+        if s[i] == s[i+1]:
             return("Bad")
     return("Good")
 s = input()
 
 print(checker(s))
Buggy program (verdict: Wrong Answer):
n = int(input())

r = n % 27
if r == 13 or r == 26:
    print(':)')
elif r ==0:
    x = int(100*n/108)
    print(x)
else:
    for i in range(1, 25):
        if 1.08*(i-1) < r <= 1.08*i:
            break
    x = int(100*(n - i)/108) + i
    print(x)

Failing test case input:
1079

Expected output:
:(

Actual output:
:)


Fixed program (verdict: Accepted):
n = int(input())

r = n % 27
if r == 13 or r == 26:
    print(':(')
elif r ==0:
    x = int(100*n/108)
    print(x)
else:
    for i in range(1, 25):
        if 1.08*(i-1) < r <= 1.08*i:
            break
    x = int(100*(n - i)/108) + i
    print(x)

Diff:
 n = int(input())
 
 r = n % 27
 if r == 13 or r == 26:
-    print(':)')
+    print(':(')
 elif r ==0:
     x = int(100*n/108)
     print(x)
 else:
     for i in range(1, 25):
         if 1.08*(i-1) < r <= 1.08*i:
             break
     x = int(100*(n - i)/108) + i
     print(x)
Buggy program (verdict: Wrong Answer):
s = list(input())
if s == "RSR":
    print(1)
    exit()
else:
    print(s.count("R"))


Failing test case input:
RSR

Expected output:
1

Actual output:
2


Fixed program (verdict: Accepted):
s = list(input())
if s == ["R","S","R"]:
    print(1)
    exit()
else:
    print(s.count("R"))


Diff:
 s = list(input())
-if s == "RSR":
+if s == ["R","S","R"]:
     print(1)
     exit()
 else:
     print(s.count("R"))
Buggy program (verdict: Wrong Answer):
from collections import Counter
n, k = map(int, input().split())
a = list(map(int, input().split()))

B = set(a) 
d = Counter(a)

num = len(B) - k 

c = d.most_common()
print(c)
ans = 0
for i in range(1, num+1):
  ans += c[-i][1]
print(ans)

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

Expected output:
1

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


Fixed program (verdict: Accepted):
from collections import Counter
n, k = map(int, input().split())
a = list(map(int, input().split()))

B = set(a) 
d = Counter(a)

num = len(B) - k 

c = d.most_common()
ans = 0
for i in range(1, num+1):
  ans += c[-i][1]
print(ans)

Diff:
 from collections import Counter
 n, k = map(int, input().split())
 a = list(map(int, input().split()))
 
 B = set(a) 
 d = Counter(a)
 
 num = len(B) - k 
 
 c = d.most_common()
-print(c)
 ans = 0
 for i in range(1, num+1):
   ans += c[-i][1]
 print(ans)
Buggy program (verdict: Wrong Answer):


import math


def calcPow(X):
    num = int(math.sqrt(X))
    print("num : " +str(num))
    Max = 0

    for i in range(2,num+1):
        for j in range(2,num+1):
            if(pow(i,j) > X):
                if(pow(i,j-1) > Max):
                    Max = pow(i,j-1)
                    break
                break

    return Max


if __name__ == '__main__':
    X = int(input())

    print(calcPow(X))


Failing test case input:
1298

Expected output:
1296


Actual output:
num : 36
1296


Fixed program (verdict: Accepted):
import math

def calcPow(X):
    num = int(math.sqrt(X))
    Max = 0

    if(X <= 3):
        return X

    for i in range(2,num+1):
        for j in range(2,X):
            if(pow(i,j) > X):
                if(pow(i,j-1) > Max):
                    Max = pow(i,j-1)
                    break
                break

    return Max


if __name__ == '__main__':
    X = int(input())

    print(calcPow(X))


Diff:
-
-
 import math
 
-
 def calcPow(X):
     num = int(math.sqrt(X))
-    print("num : " +str(num))
     Max = 0
 
+    if(X <= 3):
+        return X
+
     for i in range(2,num+1):
-        for j in range(2,num+1):
+        for j in range(2,X):
             if(pow(i,j) > X):
                 if(pow(i,j-1) > Max):
                     Max = pow(i,j-1)
                     break
                 break
 
     return Max
 
 
 if __name__ == '__main__':
     X = int(input())
 
     print(calcPow(X))
Buggy program (verdict: Wrong Answer):
N = int(input())
numbers = list(map(int, input().split()))

if len(numbers) == N:
  print('YES')
else:
  print('NO')


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

Expected output:
NO


Actual output:
YES


Fixed program (verdict: Accepted):
N = int(input())
numbers = set(map(int, input().split()))

if len(numbers) == N:
  print('YES')
else:
  print('NO')


Diff:
 N = int(input())
-numbers = list(map(int, input().split()))
+numbers = set(map(int, input().split()))
 
 if len(numbers) == N:
   print('YES')
 else:
   print('NO')
Buggy program (verdict: Wrong Answer):
N,M=map(int,input().split())
temp=0
TEMP=N-1
for i in range(M):
    a,b=map(int,input().split())
    if a-1>temp:
        temp=a-1
    if TEMP>b-1:
        TEMP=b-1
print(TEMP-temp+1)


Failing test case input:
17 3
3 2
7 7
6 9

Expected output:
0


Actual output:
-4


Fixed program (verdict: Accepted):
N,M=map(int,input().split())
temp=0
TEMP=N-1
for i in range(M):
    a,b=map(int,input().split())
    if b-1<temp or TEMP<a-1:
        print(0)
        exit()
    if a-1>temp:
        temp=a-1
    if TEMP>b-1:
        TEMP=b-1
    
print(TEMP-temp+1)


Diff:
 N,M=map(int,input().split())
 temp=0
 TEMP=N-1
 for i in range(M):
     a,b=map(int,input().split())
+    if b-1<temp or TEMP<a-1:
+        print(0)
+        exit()
     if a-1>temp:
         temp=a-1
     if TEMP>b-1:
         TEMP=b-1
+    
 print(TEMP-temp+1)
Buggy program (verdict: Wrong Answer):
S = input()
S_int = map(int, S)

if len(S) == 1:
    print(0)
else:
    s = list(S_int)
    def reverse_count(s, initial):
        count = 0
        c = initial
        for i in range(len(s) - 1):
            if s[i] != c:
                count += 1
            c = (c + 1) % 2
        return count
        
    
    print(min(reverse_count(s, 0), reverse_count(s, 1)))

Failing test case input:
10000100

Expected output:
4


Actual output:
3


Fixed program (verdict: Accepted):
S = input()
S_int = map(int, S)

if len(S) == 1:
    print(0)
else:
    s = list(S_int)
    def reverse_count(s, initial):
        count = 0
        c = initial
        for i in range(len(s)):
            if s[i] != c:
                count += 1
            c = (c + 1) % 2
        return count
        
    
    print(min(reverse_count(s, 0), reverse_count(s, 1)))

Diff:
 S = input()
 S_int = map(int, S)
 
 if len(S) == 1:
     print(0)
 else:
     s = list(S_int)
     def reverse_count(s, initial):
         count = 0
         c = initial
-        for i in range(len(s) - 1):
+        for i in range(len(s)):
             if s[i] != c:
                 count += 1
             c = (c + 1) % 2
         return count
         
     
     print(min(reverse_count(s, 0), reverse_count(s, 1)))
Buggy program (verdict: Wrong Answer):
n, *t = map( int, open( 0 ).read().split() )


A, B, C = 0, 0, 0
for i in  range( n ):
  A, B, C = t[ 3 * i  ] + max( B, A ), t[ 3 * i + 1 ] + max( A, C ), t[ 3 * i + 2 ] + max( A, B )

print( max( A, B, C ) )


Failing test case input:
3
2 39 1
0 10 5
14 1 4

Expected output:
58


Actual output:
53


Fixed program (verdict: Accepted):
n, *t = map( int, open( 0 ).read().split() )
 

A, B, C = 0, 0, 0
for i in  range( n ):
  A, B, C = t[ 3 * i  ] + max( B, C ), t[ 3 * i + 1 ] + max( A, C ), t[ 3 * i + 2 ] + max( A, B )
 
print( max( A, B, C ) )


Diff:
 n, *t = map( int, open( 0 ).read().split() )
-
+ 
 
 A, B, C = 0, 0, 0
 for i in  range( n ):
-  A, B, C = t[ 3 * i  ] + max( B, A ), t[ 3 * i + 1 ] + max( A, C ), t[ 3 * i + 2 ] + max( A, B )
-
+  A, B, C = t[ 3 * i  ] + max( B, C ), t[ 3 * i + 1 ] + max( A, C ), t[ 3 * i + 2 ] + max( A, B )
+ 
 print( max( A, B, C ) )
Buggy program (verdict: Wrong Answer):
import sys
def input():
    return sys.stdin.readline()[:-1]
N=int(input())
S=[input() for i in range(N)]
a=0
for i in range(N):
    for j in range(N-1):
        for k in range(j+1,N):
            if S[(j+i)%N][k]!=S[k][(j+i)%N]:
                break
        else:
            continue
        break
    else:
        a+=1
print(a*N)

Failing test case input:
2
bc
ba

Expected output:
0


Actual output:
2


Fixed program (verdict: Accepted):
N=int(input())
S=[input() for i in range(N)]
a=0
for i in range(N):
    for j in range(N-1):
        for k in range(j+1,N):
            if S[(j+i)%N][k]!=S[(k+i)%N][j%N]:
                break
        else:
            continue
        break
    else:
        a+=1
print(a*N)

Diff:
-import sys
-def input():
-    return sys.stdin.readline()[:-1]
 N=int(input())
 S=[input() for i in range(N)]
 a=0
 for i in range(N):
     for j in range(N-1):
         for k in range(j+1,N):
-            if S[(j+i)%N][k]!=S[k][(j+i)%N]:
+            if S[(j+i)%N][k]!=S[(k+i)%N][j%N]:
                 break
         else:
             continue
         break
     else:
         a+=1
 print(a*N)
Buggy program (verdict: Wrong Answer):
w=input()
l=[]
c=0
for i in w:
  l.append(i)
l.sort()
for k in range(len(l)-1):
  if l[k]==l[k+1]:
    c+=1
  elif c%2==1:
    c=0
    continue
  else:
    print('NO')
    exit()
print('YES')

Failing test case input:
igssh

Expected output:
No


Actual output:
NO


Fixed program (verdict: Accepted):
w=input()
l=[]
c=0
for i in w:
  l.append(i)
l.sort()
if len(l)<2:
  print('No')
  exit()
for k in range(len(l)-1):
  if l[k]==l[k+1]:
    c+=1
  elif c%2==1:
    c=0
    continue
  else:
    print('No')
    exit()
print('Yes')

Diff:
 w=input()
 l=[]
 c=0
 for i in w:
   l.append(i)
 l.sort()
+if len(l)<2:
+  print('No')
+  exit()
 for k in range(len(l)-1):
   if l[k]==l[k+1]:
     c+=1
   elif c%2==1:
     c=0
     continue
   else:
-    print('NO')
+    print('No')
     exit()
-print('YES')
+print('Yes')
Buggy program (verdict: Wrong Answer):
import bisect
n = int(input())
l = list(map(int, input().split()))
l.sort()

cnt = 0

print(l)
for i in range(n - 1, 0, -1):
    for j in range(i - 1, -1, -1):
        base = l[i] - l[j]
        idx = bisect.bisect_right(l, base)
        cnt += max(j - idx, 0)
print(cnt)




Failing test case input:
7
153 3264 1874 14 248 149 5

Expected output:
3


Actual output:
[5, 14, 149, 153, 248, 1874, 3264]
3


Fixed program (verdict: Accepted):
import bisect
n = int(input())
l = list(map(int, input().split()))
l.sort()

cnt = 0

for i in range(n - 1, 0, -1):
    for j in range(i - 1, -1, -1):
        base = l[i] - l[j]
        idx = bisect.bisect_right(l, base)
        cnt += max(j - idx, 0)
print(cnt)




Diff:
 import bisect
 n = int(input())
 l = list(map(int, input().split()))
 l.sort()
 
 cnt = 0
 
-print(l)
 for i in range(n - 1, 0, -1):
     for j in range(i - 1, -1, -1):
         base = l[i] - l[j]
         idx = bisect.bisect_right(l, base)
         cnt += max(j - idx, 0)
 print(cnt)
Buggy program (verdict: Wrong Answer):
N = input()
aryA = input().split(" ")

N = int(N)
aryA = [int(s) for s in aryA]
ans = []
for x in range(len(aryA) - 1):
    ans.append(abs(aryA[x+1] - aryA[x]))

print(max(ans))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
3


Fixed program (verdict: Accepted):
N = input()
aryA = input().split(" ")

N = int(N)
aryA = [int(s) for s in aryA]
ans = []
for x in range(len(aryA) - 1):
    for y in range(len(aryA)):
        ans.append(abs(aryA[x] - aryA[y]))

print(max(ans))

Diff:
 N = input()
 aryA = input().split(" ")
 
 N = int(N)
 aryA = [int(s) for s in aryA]
 ans = []
 for x in range(len(aryA) - 1):
-    ans.append(abs(aryA[x+1] - aryA[x]))
+    for y in range(len(aryA)):
+        ans.append(abs(aryA[x] - aryA[y]))
 
 print(max(ans))
Buggy program (verdict: Wrong Answer):
from sys import stdin

while True:
    n, x = [int(x) for x in stdin.readline().rstrip().split()]
    if n == 0 and x == 0:
        break
    else:
        count = 0
        for i in range(1, n-1):
            for j in range(i+1, n-2):
                if j < x-i-j <= n:
                    count += 1
        else:
            print(count)


Failing test case input:
8 14
0 0

Expected output:
6


Actual output:
5


Fixed program (verdict: Accepted):
from sys import stdin

while True:
    n, x = [int(x) for x in stdin.readline().rstrip().split()]
    if n == 0 and x == 0:
        break
    else:
        count = 0
        for i in range(1, n-1):
            for j in range(i+1, n):
                if j < x-i-j <= n:
                    count += 1
        else:
            print(count)


Diff:
 from sys import stdin
 
 while True:
     n, x = [int(x) for x in stdin.readline().rstrip().split()]
     if n == 0 and x == 0:
         break
     else:
         count = 0
         for i in range(1, n-1):
-            for j in range(i+1, n-2):
+            for j in range(i+1, n):
                 if j < x-i-j <= n:
                     count += 1
         else:
             print(count)
Buggy program (verdict: Wrong Answer):
L,R,d=map(int,input().split())
if R%d!=0:
    print(int(R/d)-int(L/d))
else:
    print(int(R/d)-int(L/d)+1)

Failing test case input:
5 10 2

Expected output:
3

Actual output:
4


Fixed program (verdict: Accepted):
L,R,d=map(int,input().split())
if L%d!=0:
    print(int(R/d)-int(L/d))
else:
    print(int(R/d)-int(L/d)+1)

Diff:
 L,R,d=map(int,input().split())
-if R%d!=0:
+if L%d!=0:
     print(int(R/d)-int(L/d))
 else:
     print(int(R/d)-int(L/d)+1)
Buggy program (verdict: Wrong Answer):



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

ans = []
for i in range(k):
    if a+i <= b:
        ans.append(a+i)
for i in range(k):
    if b-(k-i)+1 >= a:
        ans.append(b-(k-i)+1)
ans = list(set(ans))
for i in range(len(ans)):
    print(ans[i])


Failing test case input:
-4 14 7

Expected output:
-4
-3
-2
-1
0
1
2
8
9
10
11
12
13
14


Actual output:
0
1
2
8
9
10
11
12
13
14
-1
-4
-3
-2


Fixed program (verdict: Accepted):



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

ans = []
for i in range(k):
    if a+i <= b:
        ans.append(a+i)
for i in range(k):
    if b-(k-i)+1 >= a:
        ans.append(b-(k-i)+1)
ans = list(set(ans))
ans.sort()
for i in range(len(ans)):
    print(ans[i])


Diff:
 
 
 
 a,b,k = list(map(int,input().split()))
 
 ans = []
 for i in range(k):
     if a+i <= b:
         ans.append(a+i)
 for i in range(k):
     if b-(k-i)+1 >= a:
         ans.append(b-(k-i)+1)
 ans = list(set(ans))
+ans.sort()
 for i in range(len(ans)):
     print(ans[i])
Buggy program (verdict: Wrong Answer):
x,k,d=list(map(int,input().split()))
print(x,k,d)
result=abs(x)-k*d
swithn=0

if result<0:
    if k%2==1:
        x-=d
    result=min(x%(2*d),-x%(2*d))
print(result)

Failing test case input:
1000111101000000 1010100001000001 1001000000001011

Expected output:
888899001011


Actual output:
1000111101000000 1010100001000001 1001000000001011
888899001011


Fixed program (verdict: Accepted):
x,k,d=list(map(int,input().split()))

result=abs(x)-k*d
swithn=0

if result<0:
    if k%2==1:
        x-=d
    result=min(x%(2*d),-x%(2*d))
print(result)

Diff:
 x,k,d=list(map(int,input().split()))
-print(x,k,d)
+
 result=abs(x)-k*d
 swithn=0
 
 if result<0:
     if k%2==1:
         x-=d
     result=min(x%(2*d),-x%(2*d))
 print(result)
Buggy program (verdict: Wrong Answer):
S=input()
N=len(S)+1
llst=[0 for i in range(N)]
rlst=[0 for i in range(N)]
for i in range(N-1):
  if S[i]=='<':
    llst[i+1]=llst[i]+1
for i in range(N-2, 0, -1):
  if S[i]=='>':
    rlst[i]=rlst[i+1]+1
ans=0
for i in range(N):
  ans+=max(llst[i], rlst[i])
print(ans)

Failing test case input:
><<<<<><><><>>><

Expected output:
25


Actual output:
24


Fixed program (verdict: Accepted):
S=input()
N=len(S)+1
llst=[0 for i in range(N)]
rlst=[0 for i in range(N)]
for i in range(N-1):
  if S[i]=='<':
    llst[i+1]=llst[i]+1
for i in range(N-2, -1, -1):
  if S[i]=='>':
    rlst[i]=rlst[i+1]+1
ans=0
for i in range(N):
  ans+=max(llst[i], rlst[i])
print(ans)

Diff:
 S=input()
 N=len(S)+1
 llst=[0 for i in range(N)]
 rlst=[0 for i in range(N)]
 for i in range(N-1):
   if S[i]=='<':
     llst[i+1]=llst[i]+1
-for i in range(N-2, 0, -1):
+for i in range(N-2, -1, -1):
   if S[i]=='>':
     rlst[i]=rlst[i+1]+1
 ans=0
 for i in range(N):
   ans+=max(llst[i], rlst[i])
 print(ans)
Buggy program (verdict: Wrong Answer):
import math

N = input()
A = list(map(int, input().split()))
n = 0
d = 0

while n >= 0:
    for a in A:
        if a%2 == 1:
            print(n)
            d += 1
    if d > 0:
        break
    A = [a/2 for a in A] 
    n += 1
    

Failing test case input:
6
105530884 1892549229 59907007 27068201 236966 136055793

Expected output:
0


Actual output:
0
0
0
0


Fixed program (verdict: Accepted):
import math

N = input()
A = list(map(int, input().split()))
n = 0
d = 0

while n >= 0:
    for a in A:
        if a%2 == 1:
            print(n)
            d += 1
            break
    if d > 0:
        break
    A = [a/2 for a in A] 
    n += 1
    

Diff:
 import math
 
 N = input()
 A = list(map(int, input().split()))
 n = 0
 d = 0
 
 while n >= 0:
     for a in A:
         if a%2 == 1:
             print(n)
             d += 1
+            break
     if d > 0:
         break
     A = [a/2 for a in A] 
     n += 1
Buggy program (verdict: Wrong Answer):
n,l=map(int,input().split())
A=[]
for i in range(n):
    A.append(l+i)
B=A.copy()
for j in range(len(B)):
    B[j]=abs(B[j])
sum(A)-A[B.index(min(B))]

Failing test case input:
3 -88

Expected output:
-175


Actual output:
no output


Fixed program (verdict: Accepted):
n,l=map(int,input().split())
A=[]
for i in range(n):
    A.append(l+i)
B=A.copy()
for j in range(len(B)):
    B[j]=abs(B[j])
print(sum(A)-A[B.index(min(B))])

Diff:
 n,l=map(int,input().split())
 A=[]
 for i in range(n):
     A.append(l+i)
 B=A.copy()
 for j in range(len(B)):
     B[j]=abs(B[j])
-sum(A)-A[B.index(min(B))]
+print(sum(A)-A[B.index(min(B))])
Buggy program (verdict: Wrong Answer):
S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
    print("Good")
else:
    print('Bad')

Failing test case input:
9215

Expected output:
Good


Actual output:
Bad


Fixed program (verdict: Accepted):
S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
    print("Bad")
else:
    print('Good')

Diff:
 S = input()
 if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
-    print("Good")
+    print("Bad")
 else:
-    print('Bad')
+    print('Good')
Buggy program (verdict: Wrong Answer):
n,x = map(int,input().split())
l = list(map(int,input().split()))
i=0
suml=0
if sum(l)<=x:
    print(len(l))
else:
    while suml<=x:
        suml=suml+l[i]
        i=i+1
    print(i)

Failing test case input:
4 9
3 2 0 3

Expected output:
5


Actual output:
4


Fixed program (verdict: Accepted):
n,x = map(int,input().split())
l = list(map(int,input().split()))
i=0
suml=0
if sum(l)<=x:
    print(len(l)+1)
else:
    while suml<=x:
        suml=suml+l[i]
        i=i+1
    print(i)


Diff:
 n,x = map(int,input().split())
 l = list(map(int,input().split()))
 i=0
 suml=0
 if sum(l)<=x:
-    print(len(l))
+    print(len(l)+1)
 else:
     while suml<=x:
         suml=suml+l[i]
         i=i+1
     print(i)
+
Buggy program (verdict: Wrong Answer):
import sys
m,d = input().split()
if m in ('1','3','5','7','8','10','12'):
  if d == '31':
    print('1')
elif m == '2':
  if d == '28':
    print('1')
else:
  print('0')


Failing test case input:
11 30
6 1

Expected output:
1


Actual output:
0


Fixed program (verdict: Accepted):
import sys
m,d = input().split()
if m in ('1','3','5','7','8','10','12'):
  if d == '31':
    print('1')
  else:
    print('0')
elif m == '2':
  if d == '28':
    print('1')
  else:
    print('0')
else:
  if d == '30':
    print('1')
  else:
    print('0')


Diff:
 import sys
 m,d = input().split()
 if m in ('1','3','5','7','8','10','12'):
   if d == '31':
     print('1')
+  else:
+    print('0')
 elif m == '2':
   if d == '28':
     print('1')
+  else:
+    print('0')
 else:
-  print('0')
+  if d == '30':
+    print('1')
+  else:
+    print('0')
Buggy program (verdict: Wrong Answer):
x = int(input())

for i in range(10^5):
  n = 2
  while x % n != 0 and n <= x/2:
    n += 1
  if n < x/2:
    x += 1
    
  else:
    print(x)
    break
      

Failing test case input:
1955

Expected output:
1973


Actual output:

Fixed program (verdict: Accepted):
x = int(input())

while True:
  n = 2
  while x % n != 0 and n <= x/2:
    n += 1
  if n < x/2:
    x += 1
    
  else:
    print(x)
    break

Diff:
 x = int(input())
 
-for i in range(10^5):
+while True:
   n = 2
   while x % n != 0 and n <= x/2:
     n += 1
   if n < x/2:
     x += 1
     
   else:
     print(x)
     break
-
Buggy program (verdict: Wrong Answer):
a,b,c,d = map(int,input().split())

for i in range(1,101):
	if i/2 % 1 :
		c = c-b
		print('c',c)
	else:
		a = a-d
		print('a',a)
	
	if a <= 0:
		print('No')
		break
	elif c <= 0:
		print('Yes')
		break



	
	

Failing test case input:
309 8 0 4

Expected output:
Yes


Actual output:
c -8
Yes


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

for i in range(1,202):
	if i/2 % 1 :
		c = c-b
	else:
		a = a-d
	
	if a <= 0:
		print('No')
		break
	elif c <= 0:
		print('Yes')
		break



	
	

Diff:
 a,b,c,d = map(int,input().split())
 
-for i in range(1,101):
+for i in range(1,202):
 	if i/2 % 1 :
 		c = c-b
-		print('c',c)
 	else:
 		a = a-d
-		print('a',a)
 	
 	if a <= 0:
 		print('No')
 		break
 	elif c <= 0:
 		print('Yes')
 		break
Buggy program (verdict: Wrong Answer):
K, S = map(int,input().split())
import itertools

ar = itertools.product(range(K+1), repeat=2)

ans = 0
for a,b in ar:
  if S - a-b <= K and S-a-b >= K: ans += 1

print(ans)


Failing test case input:
5 5

Expected output:
21


Actual output:
1


Fixed program (verdict: Accepted):
K, S = map(int,input().split())
import itertools

ar = itertools.product(range(K+1), repeat=2)

ans = 0
for a,b in ar:
  if S - a-b <= K and a+b <= S: ans += 1

print(ans)


Diff:
 K, S = map(int,input().split())
 import itertools
 
 ar = itertools.product(range(K+1), repeat=2)
 
 ans = 0
 for a,b in ar:
-  if S - a-b <= K and S-a-b >= K: ans += 1
+  if S - a-b <= K and a+b <= S: ans += 1
 
 print(ans)
Buggy program (verdict: Wrong Answer):
def gcd(a, b):  
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


N = int(input())
A = list(map(int, input().split()))
R = [0 for i in range(N - 1)]
L = [0 for i in range(N - 1)]
R[0] = A[0]
L[0] = A[-1]
for i in range(1, N - 1):
    R[i] = gcd(R[i - 1], A[i])
for j in range(1, N - 1):
    L[j] = gcd(L[j - 1], A[-1 - j])
    
t = 0
for i in range(N - 2):
    print(R[i], L[N - 3 - i])
    t = max(t, gcd(R[i], L[N - 3 - i]))
print(max(t, R[-1], L[-1]))


Failing test case input:
3
32 24 1

Expected output:
8


Actual output:
32 1
8


Fixed program (verdict: Accepted):
def gcd(a, b):  
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


N = int(input())
A = list(map(int, input().split()))
R = [0 for i in range(N - 1)]
L = [0 for i in range(N - 1)]
R[0] = A[0]
L[0] = A[-1]
for i in range(1, N - 1):
    R[i] = gcd(R[i - 1], A[i])
for j in range(1, N - 1):
    L[j] = gcd(L[j - 1], A[-1 - j])
    
t = 0
for i in range(N - 2):
    
    t = max(t, gcd(R[i], L[N - 3 - i]))
print(max(t, R[-1], L[-1]))


Diff:
 def gcd(a, b):  
     a, b = max(a, b), min(a, b)
     if b == 0:
         return a
     else:
         return gcd(b, a % b)
 
 
 N = int(input())
 A = list(map(int, input().split()))
 R = [0 for i in range(N - 1)]
 L = [0 for i in range(N - 1)]
 R[0] = A[0]
 L[0] = A[-1]
 for i in range(1, N - 1):
     R[i] = gcd(R[i - 1], A[i])
 for j in range(1, N - 1):
     L[j] = gcd(L[j - 1], A[-1 - j])
     
 t = 0
 for i in range(N - 2):
-    print(R[i], L[N - 3 - i])
+    
     t = max(t, gcd(R[i], L[N - 3 - i]))
 print(max(t, R[-1], L[-1]))