Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = 0
for i in range(n+1):
  l = list(i)
  if len(l) % 2 == 1:
    s += 1
print(s)

Fixed submission:
n = int(input())
s = 0
for i in range(1,n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

Buggy python submission (verdict: Runtime Error):
n = input()
s = 0
for i in range(n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

Fixed submission:
n = int(input())
s = 0
for i in range(1,n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

Buggy python submission (verdict: Runtime Error):
n = input()
s = 0
for i in range(n+1):
  l = list(int(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

Fixed submission:
n = int(input())
s = 0
for i in range(1,n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

Buggy python submission (verdict: Runtime Error):
n = input()
s = 0
for i in range(n+1):
  l = list(i)
  if len(l) % 2 = 1:
    s += 1
print(s)

Fixed submission:
n = int(input())
s = 0
for i in range(1,n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = a+b
print(c//2 if c%2==0)


Fixed submission:
a, b = map(int, input().split())
c = a + b
if c % 2 == 0:
  print(c//2)
else:
  print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
ans = 0
for i in range(n):
  if a[i] + a[i+1] <= b[i]:
    s += a[i] + a[i+1]
    a[i+1] = 0
  elif a[i] + a[i+1] > b[i] and a[i] <= b[i]:
    s += b[i]
    a[i+1] -= b[i] - a[i]
  elif a[i] > b[i]:
    s += a[i]
print(s)
    
    

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
s = 0
for i in range(n):
  if a[i] + a[i+1] <= b[i]:
    s += a[i] + a[i+1]
    a[i+1] = 0
  elif a[i] + a[i+1] > b[i] and a[i] <= b[i]:
    s += b[i]
    a[i+1] -= b[i] - a[i]
  elif a[i] > b[i]:
    s += b[i]
print(s)
Buggy python submission (verdict: Runtime Error):
print(3 * (int(input())**2 )

Fixed submission:
r = int(input())
print(3 * r**2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]
s = max(a)
if a.count(s) >= 2:
  for i in range(n):  
    print(s)
else:
  for i in range(n):
    l = a.copy()
    l[i] = 0
    print(max(l))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
s = max(a)
if a.count(s) >= 2:
  for i in range(n):  
    print(s)
else:
  for i in range(n):
    if a[i] == s:
      l = a.copy()
      l.sort()
      print(l[-2])
    else:
      print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]
s = max(a)
for i in range(n):
  if a[i] == s:
    l = a.copy()
    l[i] = 0
    print(max(l))
  else:
    print(s)



  

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
s = max(a)
if a.count(s) >= 2:
  for i in range(n):  
    print(s)
else:
  for i in range(n):
    if a[i] == s:
      l = a.copy()
      l.sort()
      print(l[-2])
    else:
      print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]
for i in range(n):
  l = a.copy()
  l[i] = 0
  print(max(l))




  

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
s = max(a)
if a.count(s) >= 2:
  for i in range(n):  
    print(s)
else:
  for i in range(n):
    if a[i] == s:
      l = a.copy()
      l.sort()
      print(l[-2])
    else:
      print(s)

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
  a = [int(j) for j in input().split()]
  a[i] = 0
  print(max(a))


  

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
s = max(a)
if a.count(s) >= 2:
  for i in range(n):  
    print(s)
else:
  for i in range(n):
    if a[i] == s:
      l = a.copy()
      l.sort()
      print(l[-2])
    else:
      print(s)
Buggy python submission (verdict: Runtime Error):
s = list(input())
if s[0] == s[1] and s[2] == s[3] and s[0] !== s[2]:
  print("Yes")
else:
  print("No")

Fixed submission:
s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = [int(i) for i in range(n)]
s = 0
for i in range(1,n-1):
  l1 = p[i-1,i+2]
  l2 = l1.copy()
  l2.sort()
  if l1[1] == l2[2]:
    s += 1
print(s)
  

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
s = 0
for i in range(1,n-1):
  l1 = p[i-1:i+2]
  l2 = l1.copy()
  l2.sort()
  if l1[1] == l2[1]:
    s += 1
print(s)
Buggy python submission (verdict: Runtime Error):
x, a = map(int, input())
if x < a:
  print(0)
else:
  print(10)

Fixed submission:
x, a = map(int, input().split())
if x < a:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = [int(i) for i in input().split()]
s = []
for i in range(1,n):
  s.append(abs(sum(w[:i])-sum(w[i:]))
print(min(s))

Fixed submission:
n = int(input())
w = [int(i) for i in input().split()]
s = []
for i in range(1,n):
  a = sum(w[:i])
  b = sum(w[i:])
  s.append(abs(b-a))
print(min(s))
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
s = list(input())
if s[k-1] == A:
  s[k-1] = a
elif s[k-1] == B:
  s[k-1] = b
else:
  s[k-1] = c
print("".join(s))


Fixed submission:
n, k = map(int, input().split())
s = list(input())
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
else:
  s[k-1] = "c"
print("".join(s))
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int n,m;
  vector<string> s(n),t(m),o(n);
  cin>>n;
  rep(i,n){
    cin>>s.at(i);
  }
  cin>>m;
  rep(j,m){
    cin>>t.at(j)
  }
  rep(i,n){
    int sss=0, ttt=0;
      rep(j,n){
        if(s.at(i)==s.at(j)){
          sss++;
        }
      }
  rep(k,m){
    if(s.at(i)==t.at(k)){
      ttt++;
    }
  }
    o.at(i) = sss - ttt;
 }
  int max=0;
  rep(i,n){
    if(max<o.at(i)){
      max = o.at(i);
    }
  }
  cout<<max;
}
  

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
l =[0]*n
for j in range(n):
  a = s.count(s[j])
  b = t.count(s[j])
  l[j] = a-b
print(max(max(l),0))

Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int n,m;
  vector<string> s(n),t(m),o(n);
  cin>>n;
  rep(i,n){
    cin>>s.at(i);
  }
  cin>>m;
  rep(j,m){
    cin>>t.at(j)
  }
  rep(i,n){
    int sss=0, ttt=0;
      rep(j,n){
        if(s.at(i)==s.at(j)){
          sss++;
        }
      }
  }
  rep(k,m){
    if(s.at(i)==t.at(k)){
      ttt++;
    }
    o.at(i) = sss - ttt;
  }
  int max=0;
  rep(i,n){
    if(max<o.at(i)){
      max = o.at(i);
    }
  }
  cout<<max;
}
  

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
l =[0]*n
for j in range(n):
  a = s.count(s[j])
  b = t.count(s[j])
  l[j] = a-b
print(max(max(l),0))

Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int n,m;
  vector<string> s(n),t(m),o(n);
  cin>>n;
  rep(i,n){
    cin>>s.at(i);
  }
  cin>>m;
  rep(j,m){
    cin>>t.at(j)
  }
  rep(i,n){
    int sss=0, ttt=0;
      rep(j,n){
        if(s.at(i)==s.at(j)){
          sss++;
        }
      }
      rep(k,m){
        if(s.at(i)==t.at(k)){
          ttt++;
        }
      o.at(i) = sss - ttt;
    }
  int max=0;
  rep(i,n){
    if(max<o.at(i)){
      max = o.at(i);
    }
  }
  cout<<max;
}
  
  
  
      
          
        
  
  
  
  
  
}

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
l =[0]*n
for j in range(n):
  a = s.count(s[j])
  b = t.count(s[j])
  l[j] = a-b
print(max(max(l),0))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
menseki=(a-1)*(b-1)
print(str(menseki))

Fixed submission:
a,b=map(int,input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
a = int(input())

b = int(input())

print(a*b)

Fixed submission:
a, b = map(int, input().split())
print(a*b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

print(a*b)

Fixed submission:
a, b = map(int, input().split())
print(a*b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a*b)

Fixed submission:
a, b = map(int, input().split())
print(a*b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(str(a * b))


Fixed submission:
a, b = map(int, input().split())
print(a*b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a * b)

Fixed submission:
a, b = map(int, input().split())
print(a*b)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(str(A*B))

Fixed submission:
a, b = map(int, input().split())
print(a*b)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(A * B)

Fixed submission:
a, b = map(int, input().split())
print(a*b)

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()

print(A * B)

Fixed submission:
a, b = map(int, input().split())
print(a*b)

Buggy python submission (verdict: Runtime Error):
A=int(input)
B=int(input)
print(A*B)

Fixed submission:
a, b = map(int, input().split())
print(a*b)

Buggy python submission (verdict: Runtime Error):
print(int(input()) * int(input()))

Fixed submission:
a, b = map(int, input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
ind = 1
for i in a:
    if i == '0':
        print(ind)
        break
    ind += 1

Fixed submission:
a = input().split()
ind = 1
for i in a:
    if i == '0':
        print(ind)
        break
    ind += 1
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())
if Y == 0:
    answer = X
else:
    list_1 = list(map(int, input().split()))

    mylist = list(range(1,101))

    list_2 = list(filter(lambda x: x not in list_1, mylist))

    import numpy as np

    abslist = np.abs(list_2)

    min_num = min(abslist)

    answer = X - min_num
    
print(answer)

Fixed submission:
X, Y = map(int, input().split())
if Y == 0:
    answer = X
else:
    list_1 = list(map(int, input().split()))

    mylist = list(range(-100, 200))

    list_2 = list(filter(lambda x: x not in list_1, mylist))
    
    list_3 = list(map(lambda x: x - X, list_2))

    import numpy as np

    abslist = np.abs(list_3)

    min_num = min(abslist)

    answer_lisbef = [X - min_num, X + min_num]
    
    answer_lisaf = list(filter(lambda x: x not in list_1, answer_lisbef))
    
    answer = min(answer_lisaf)
print(answer)
Buggy python submission (verdict: Runtime Error):
wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
answer

Fixed submission:
H1, M1, H2, M2, K = map(int, input().split())

wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
print(answer)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import numpy.random as random
import scipy as sp
import pandas as pd
from pandas import Series, DataFrame
import math
 
wakeup = 60 * H
1
 + 
M
1


gotobed = 60 * H
2 + M
2


 
wake = gotobed - wakeup
 
answer = wake - K
 
answer

Fixed submission:
H1, M1, H2, M2, K = map(int, input().split())

wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
print(answer)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import numpy.random as random
import scipy as sp
import pandas as pd
from pandas import Series, DataFrame
import math
 
wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
answer

Fixed submission:
H1, M1, H2, M2, K = map(int, input().split())

wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
print(answer)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import numpy.random as random
import scipy as sp
import pandas as pd
from pandas import Series, DataFrame
import math

wakeup = 24 * H1 + M1
gotobed = 24 * H2 + M2

wake = gotobed - wakeup

answer = wake - K

answer


Fixed submission:
H1, M1, H2, M2, K = map(int, input().split())

wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
print(answer)
Buggy python submission (verdict: Runtime Error):
x = map(int,input().split())

num = 0

for i in range(5):
	num += 1
    if x[i] == 0:
      break

print(num)

Fixed submission:
x = list(map(int,input().split()))

num = 0

for i in range(5):
	num += 1
	if x[i] == 0:
		break
        
print(num)

Buggy python submission (verdict: Runtime Error):
x = list(map(int,input().split()))

num = 0

for i in range(len(x)):
	num += 1
    if x[i] == 0:
      print(num)
      break


Fixed submission:
x = list(map(int,input().split()))

num = 0

for i in range(5):
	num += 1
	if x[i] == 0:
		break
        
print(num)

Buggy python submission (verdict: Runtime Error):
x = list(int(input()))

num = 0

for i in x:
	num += i
    if x[i]==0:
    	break
print(num)



Fixed submission:
x = list(map(int,input().split()))

num = 0

for i in range(5):
	num += 1
	if x[i] == 0:
		break
        
print(num)
Buggy python submission (verdict: Runtime Error):
s,w = int(input())

if s<=w:
  print("unsafe")
else:
  print("safe")

Fixed submission:
s,w = map(int,input().split())

if s<=w:
  print("unsafe")
else:
  print("safe")
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
A = list(map(int,input().split()))
 
for i in range(m):
  n -= A(i)
  
if n < 0:
  print(-1)
else:
  print(n)

Fixed submission:
n,m = map(int,input().split())
A = list(map(int,input().split()))
 
for i in range(m):
  n -= A[i]
  
if n < 0:
  print(-1)
else:
  print(n)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
A = list(map(int.input().split()))

for i in range(m):
  n -= A(i)
  
if n < 0:
  print(-1)
else:
  print(n)

Fixed submission:
n,m = map(int,input().split())
A = list(map(int,input().split()))
 
for i in range(m):
  n -= A[i]
  
if n < 0:
  print(-1)
else:
  print(n)

Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
A = list(map(int,input().split()))

hw_days = 0

for i in len(A):
  hw_days += A(i)

vacation = n - hw_days

if vacation < 0:
  print(-1)
else:
  print(vacation)

Fixed submission:
n,m = map(int,input().split())
A = list(map(int,input().split()))
 
for i in range(m):
  n -= A[i]
  
if n < 0:
  print(-1)
else:
  print(n)
Buggy python submission (verdict: Runtime Error):
n = int(input())

if 7 in n:
  print("Yes")
else:
  print("No")

Fixed submission:
n = int(input())
num = []
while n>0:
  num.append(n%10)
  n //= 10

ans = 0
for i in num:
  if i == 7:
    ans+=1
    break
  else:
    ans = 0
    
if ans >= 1:
  print("Yes")
elif ans==0:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math
k = int(input())
sum = []
for a in range(1,k+1):
  for b in range(1,k+1):
    ab = math.gcd(a,b)
    for c in range(1,k+1):
      sum += math.gcd(ab,c)
print(sum)
  

Fixed submission:
import math
k = int(input())
sum = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    ab = math.gcd(a,b)
    for c in range(1,k+1):
      sum += math.gcd(ab,c)
print(sum)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input())
if n >= 2:
	for i in range(n):
		i *= i
if m >= 2:
	for j in range(m):
    	j *= j
print(i+j//4)

Fixed submission:
m,n =  map(int, input().split())
print(n*(n-1)//2+m*(m-1)//2)

Buggy python submission (verdict: Runtime Error):
M, N = map(int, input().split())

num1 = 1
list_M = []

for i in M:
  list_M.append(i)
  num1 += 1

num2 = 1
list_n = []
for j in N:
  list_N.append(j)
  num2 += 1

add_list = []
for k in M:
  for l in N:
    add_list.append(list_m[k] + list[l])

odd = 0

for m in add_list:
  if m % 2 == 0:
    odd += 1
    
print(odd)
    

Fixed submission:
m,n =  map(int, input().split())
print(n*(n-1)//2+m*(m-1)//2)
Buggy python submission (verdict: Runtime Error):
n,r = map(int,input().split())

if n >= 10:
	print(r)
else:
	r -= 100*(10-n)
    print(r)

Fixed submission:
n,r = map(int,input().split())

if n >= 10:
  print(r)
else:
  r += 100*(10-n)
  print(r)
Buggy python submission (verdict: Runtime Error):
S = list(input())
print(x*len(S))

Fixed submission:
S = list(input())
print("x" * len(S))
Buggy python submission (verdict: Runtime Error):
S = int(input())
if S = "Sunny":
  print("Cloudy")
elif S = "Cloudy":
  print("Rainy")
elif S ="Rainy":
  print("Sunny")
  

Fixed submission:
S = input()
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
elif S == "Rainy":
  print("Sunny")
Buggy python submission (verdict: Runtime Error):
a,p = map(int,input().split())
p = 3a + p
print(p//2)

Fixed submission:
A, P = map(int, input().split())
K = A * 3
X = (K + P) // 2
print(X)
Buggy python submission (verdict: Runtime Error):
r, D, x = map(int, input().split())
2<=r<=5
1<=D<=100
D<=x<=200
while x <= 200 :
    x = r*x - D
    print(x)

Fixed submission:
A, B = map(int, input().split())
0<=A<=100
2<=B<=100
if 0<=A<=5 :
    B=0
elif 6<=A<=12 :
    B=B//2
else :
    B=B
print(B)

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
0<=A<=100
2<=B<=100

if 0 <= A <= 5 :
    B = 0
elif 6 <= A <= 13 :
    B = B//2
else :
    B = B
    if B & 1:
        print(B)
    else :
        break


Fixed submission:
A, B = map(int, input().split())
0<=A<=100
2<=B<=100
if 0<=A<=5 :
    B=0
elif 6<=A<=12 :
    B=B//2
else :
    B=B
print(B)

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
0<=A<=100
2<=B<=100

if 0 <= A <= 5 :
    B = 0
elif 6 <= A <= 13 :
    B = B//2
else :
    B = B
    if B % 2 == 0 :
        print(B)
    else :
        break


Fixed submission:
A, B = map(int, input().split())
0<=A<=100
2<=B<=100
if 0<=A<=5 :
    B=0
elif 6<=A<=12 :
    B=B//2
else :
    B=B
print(B)

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
0 <= A <= 100

if 6 <= A <= 13 :
     B = B//2
elif 0 <= A <= 5 :
     B = 0
else :
     B = B
print(B)

Fixed submission:
A, B = map(int, input().split())
0<=A<=100
2<=B<=100
if 0<=A<=5 :
    B=0
elif 6<=A<=12 :
    B=B//2
else :
    B=B
print(B)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
h = input()

area = (a + b)*h/2

print(area)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)
Buggy python submission (verdict: Runtime Error):
anim, leg = [int(x) for x in input().split()] 

y = (leg - 2anim) / 2
x = (4anim - leg) / 2

if isinstance(y, float) or isinstance(x, float) or y < 0 or x < 0:
  print("No")
else:
  print("Yes")

Fixed submission:
anim, leg = [int(x) for x in input().split()]


y = (leg - 2*anim)  
x = (4*anim - leg)  

if y % 2 == 1 or x % 2 == 1 or y < 0 or x < 0:
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
import sympy
x = sympy.Symbol('x')
y = sympy.Symbol('y')

s = input()
lst = s.split()

ex1 = x + y - int(lst[0])
ex2 = 2 * x + 4 * y - int(lst[1])

d = sympy.solve([ex1, ex2])

if d[x] >= 0 and d[y] >= 0:
    print("yes")
else:
    print("no")



Fixed submission:
s = input()
lst = s.split()

ex1 = int(lst[0])
ex2 = int(lst[1])
ret = "No"

for i in range(ex1+1):
    if 4 * (ex1 - i) + 2 * i == ex2:
        ret= "Yes"

print(ret)
Buggy python submission (verdict: Runtime Error):
a,b,c,k=list(map(int,input().split()))
A=[1]*a
B=[0]*b
C=[-1]*c
s=A+B+C
ans=0
for i in range(k):
  ans+=s[i]
print(ans)

Fixed submission:
a,b,c,k=list(map(int,input().split()))
ans=0
if(k<=a):
  ans=k
elif(a<k and k<=a+b):
  ans=a
elif(a+b<k and k<=a+b+c):
  ans=a-(k-a-b)

print(ans)
Buggy python submission (verdict: Runtime Error):
N,M,X=list(map(int,input().split()))
AC=[]
C=[]
A=[]
for n in range(N):
  AC.append(list(map(int,input().split())))
  C.append(AC[0])
  A.append(AC[1:])
ans=0
for n in range(2**N):
  total=0
  und=[0]*M
  for j in range(N):
    if n >> j & 1:
      total+=C[j]
      for m in range(M):
        und[m]+=A[j][m]
  if X <= min(und):
    ans=total
if ans==0:
  print(-1)
else:
  print(ans)
    

Fixed submission:
N,M,X=list(map(int,input().split()))

C=[]
A=[]
for n in range(N):
  AC=list(map(int,input().split()))
  C.append(AC[0])
  A.append(AC[1:])
ans=10**9

for n in range(2**N):
  total=0
  und=[0]*M
  for j in range(N):
    if n >> j & 1:
      total+=C[j]
      for m in range(M):
        und[m]+=A[j][m]
  if X <= min(und):
    ans=min(total,ans)
if ans==10**9:
  print(-1)
else:
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
src=list(map(int,input().split()))
L=[i+a for i,a in enumerate(src,1)]
R=[i-a for i,a in enumerate(src,1) if 0<=i-a]
ans=0
for l in L:
  for n in range(len(R)):
    if R[n] == l:
      ans+=1
print(ans)

Fixed submission:
from collections import defaultdict
N=int(input())
src=list(map(int,input().split()))
ans=0
d=defaultdict(int)
e=[]
for i,s in enumerate(src,1):
  l=i+s
  r=i-s
  d[l]+=1
  ans+=d[r]

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
src=list(map(int,input().split()))
L=[i+a for i,a in enumerate(src,1)]
R=[i-a for i,a in enumerate(src,1)]
ans=0
for l in L:
  for n in range(N):
    if R[n] == l:
      ans+=1
print(ans)

Fixed submission:
from collections import defaultdict
N=int(input())
src=list(map(int,input().split()))
ans=0
d=defaultdict(int)
e=[]
for i,s in enumerate(src,1):
  l=i+s
  r=i-s
  d[l]+=1
  ans+=d[r]

print(ans)
Buggy python submission (verdict: Runtime Error):
N,M=list(map(int, input().split()))
src=[i+1 for i in range(M*2+1)]
if N%2==0:
  for m in range(M//2):
    a=src[m]
    b=src[M-m]
    print('{} {}'.format(a,b))
  for m in range(M//2):
    a=src[M+1+m]
    b=src[-(m+1)]
    print('{} {}'.format(a,b))
else:
  for m in range(M//2):
    a=src[m]
    b=src[M-1-m]
    print('{} {}'.format(a,b))
  for m in range(M-(M//2)):
    a=src[M+m]
    b=src[-(m+1)]
    print('{} {}'.format(a,b))

Fixed submission:
K = int(input())
a,b = list(map(int, input().split()))
n = 0
while True:
  n += 1
  if a <= n*K and n*K <= b:
    print('OK')
    break
  if b < n*K:
    print('NG')
    break

Buggy python submission (verdict: Runtime Error):
N,M=list(map(int, input().split()))
src=[i+1 for i in range(M*2+1)]
if N%2==0:
  for m in range(M//2):
    a=src[m]
    b=src[M-m]
    print('{} {}'.format(a,b))
  for m in range(M//2):
    a=src[M+1+m]
    b=src[-(m+1)]
    print('{} {}'.format(a,b))
else:
  for m in range(M//2):
    a=src[m]
    b=src[M-1-m]
    print('{} {}'.format(a,b))
  for m in range(M-(M//2)):
    a=src[M+m]
    b=src[-(m+1)]
    print('{} {}'.format(a,b))

Fixed submission:
K = int(input())
a,b = list(map(int, input().split()))
n = 0
while True:
  n += 1
  if a <= n*K and n*K <= b:
    print('OK')
    break
  if b < n*K:
    print('NG')
    break
Buggy python submission (verdict: Runtime Error):
import itertools
N,M,Q=list(map(int,input().split()))
src=[list(map(int,input().split())) for q in range(Q)]
ML=[n+1 for n in range(M)]
X=list(itertools.combinations_with_replacement(ML,N))
L=[]
for x in X:
  a=0
  for s in src:
    if x[s[1]] - x[s[0]] == s[2]:
      a+=s[3]
  L.append(a)
print(max(L))

Fixed submission:
import itertools
N,M,Q=list(map(int,input().split()))
src=[]
for q in range(Q):
  src.append(list(map(int,input().split())))
ML=[n+1 for n in range(M)]
X=list(itertools.combinations_with_replacement(ML,N))
L=[]
for x in X:
  a=0
  for s in src:
    if x[s[1]-1] - x[s[0]-1] == s[2]:
      a+=s[3]
  L.append(a)
print(max(L))