Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02960 (python)

Fixed submission:
S=input()[::-1]
l=len(S)
a=1
m=10**9+7
dp=[1]+[0]*12
for d in S:
    dp2=[0]*13
    if d=='?':
        for j in range(13):
            for k in range(10):
                dp2[(j+k*a)%13]+=dp[j]%m
    else:
        for j in range(13):
            dp2[(j+int(d)*a)%13]=dp[j]
    dp=dp2
    a=(a*10)%13 if a!=1 else 10
print(dp[5]%m)

Buggy submission (verdict: Runtime Error):
S=list(input())
for i in range(int(input())):
    q=input()
    if q=='1':
        S.reverse()
    else:
        a,f,c=q.split()
        S=[c]+S if f=='1' else S+[c] 
print(''.join(S))
Problem p02975 (python)

Fixed submission:
from collections import*
n,*A=map(int,open(0).read().split());C=Counter(A).items();f=1;l=len(C)
if l==3:
  x=0
  for c in C:x^=c[0]
  f=(len(set(c[1]for c in C))>1)+n%3+x>0
elif l==2:f=(abs(sum(c[1]*(-1)**i for i,c in enumerate(C)))!=n//3)+n%3>0
else:f=(l!=1)+A[0]>0
print('YNeos'[f::2])

Buggy submission (verdict: Runtime Error):
from collections import*
n,*A=map(int,open(0).read().split());C=Counter(A).items();f=1;l=len(C)
if l==3:f=(len(set(c[1]for c in C))>1)+n%3>0
elif l==2:f=(abs(C[1][1]-C[0][1])!=n//3)+n%3>0
else:f=(l!=1)+A[0]>0
print('YNeos'[f::2])

Buggy submission (verdict: Runtime Error):
from collections import*
n,*A=map(int,open(0).read().split());C=Counter(A).items();f=1;l=len(C)
if l==3:f=(len(set(c[1]for c in C))>1)+n%3>0
elif l==2:f=(abs(C[1][1]-C[0][1])!=n//3)+n%3>0
else:f=(l!=1)*(A[0]>0)
print('YNeos'[f::2])
Problem p02981 (python)

Fixed submission:
N, A, B = (int(x) for x in input().split())
if(N * A < B):
  print(N * A)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
N, A, B = (int(x) for x in input().split)
if(N * A > B):
  print(N * A)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
N = int(input("N = "))
A = int(input("A = "))
B = int(input("B = "))
train = N * A
taxi = B
if train >= taxi:
    print(taxi)
else:
    print(train)
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())
ans = 10000
 
for i in range(L, min(R + 1, L + 2020)):
  for j in range(i,  min(R + 1, L + 2020)):
    if i < j:
      ans = min(ans, (i * j)%2019)
 
print(ans)

Buggy submission (verdict: Runtime Error):
N = R - L
A = []
A.append(10000)
if(L >= R):
    print(0)
elif(L == 0):
    print(0)
else:
    if(N = 1):
        print((L * R) % 2019)
    else:
        for i in range(L, R + 1):
            for j in range(i + 1, R + 1):
                A.append((i * j) % 2019)
        print(min(A))

Buggy submission (verdict: Runtime Error):
L, R = (int(x) for x in input().split())
L = L % 2019
R = R % 2019
if(L > R):
    print(0)
elif(L == 0):
    print(0)
N = R - L
A = []
if(N == 1):
    print(L * R % 2019)
else:
    for i in range(N):
        for j in range(i):
            A.append((L + i) * (L + j) % 2019)
    print(min(A))
Problem p02988 (python)

Fixed submission:
#ABC132 B
n = int(input())
p = list(map(int, input().split()))
C = 0
for i in range(1, n - 1):
    L = [p[i - 1], p[i], p[i + 1]]
    L.sort()
    if p[i] == L[1]:
        C += 1
print(C)

Buggy submission (verdict: Runtime Error):
#ABC132 A
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")
Problem p02995 (python)

Fixed submission:
#ABC131 C
import fractions

A, B, C, D = map(int, input().split())
def ad(X):
    XmodC = int(X // C)
    XmodD = int(X // D)
    CD_lcm = int(C * D / fractions.gcd(C, D))
    XmodCD = int(X // CD_lcm)
    return X - (XmodC + XmodD - XmodCD)
ans = ad(B) - ad(A - 1)
print(ans)

Buggy submission (verdict: Runtime Error):
#ABC131 C
import math

A, B, C, D = map(int, input().split())
def ad(X):
    XmodC = X // C
    XmodD = X // D
    CD_lcm = C * D / math.gcd(C, D)
    XmodCD = X // CD_lcm
    return X - int(XmodC + XmodD - XmodCD)
ans = int(ad(B) - ad(A - 1))
print(ans)

Buggy submission (verdict: Runtime Error):
#ABC131 C
import math

A, B, C, D = map(int, input().split())
def ad(X):
    XmodC = X // C
    XmodD = X // D
    CD_lcm = C * D / math.gcd(C, D)
    XmodCD = X // CD_lcm
    return X - int(XmodC + XmodD - XmodCD)
print(ad(B) - ad(A - 1))

Buggy submission (verdict: Runtime Error):
#ABC131 C
import math

A, B, C, D = (int(_) for _ in input().split())
def ad(X):
    XmodC = X // C
    XmodD = X // D
    CD_lcm = C * D / math.gcd(C, D)
    XmodCD = X // CD_lcm
    return X - int(XmodC + XmodD - XmodCD)
print(ad(B) - ad(A - 1))

Buggy submission (verdict: Runtime Error):
#ABC131 C
import math
A, B, C, D = (int(_) for _ in input().split())
def ad(X):
    XmodC = X // C
    XmodD = X // D
    CD_lcm = C * D / math.gcd(C, D)
    XmodCD = X // CD_lcm
    return X - (XmodC + XmodD - XmodCD)
print(int(ad(B) - ad(A - 1)))

Buggy submission (verdict: Runtime Error):
#ABC131 C
import math
A, B, C, D = (int(_) for _ in input().split())
ABmodC = B // C - A // C
ABmodD = B // D - A // D
CD_lcm = C * D / math.gcd(C, D)
ABmodCD = B // CD_lcm - A // CD_lcm
print(int(ABmodC + ABmodD - ABmodCD))
Problem p02999 (python)

Fixed submission:
X, A = (int(_) for _ in input().split())
if X >= A:
      print(10)
else:
      print(0)

Buggy submission (verdict: Runtime Error):
X, A = (int(_) for _ in input().split())
if x >= A:
      print(10)
else:
      print(0)

Buggy submission (verdict: Runtime Error):
X, A = (int(_) for _ in input().split())
if x >= A:
  print(10)
else:
  print(0)
Problem p03000 (python)

Fixed submission:
N, X = (int(_) for _ in input().split())
L = list(map(int, input().split()))
D = [0 for i in range(N + 1)]
ans = 0
for i in range(N):
    D[i + 1]= D[i] + L[i]
for i in range(N + 1):
    if D[i] <= X:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, X = (int(_) for _ in input().split())
L = list(map(int, input().split()))
D = 0
ans = 1
while (D < X or ans < N):
    D += L[ans - 1]
    ans += 1
if D == X:
    print(ans)
else:
    print(ans - 1)

Buggy submission (verdict: Runtime Error):
N, X = (int(_) for _ in input().split())
L = list(map(int, input().split()))
D = 0
ans = 1
while (D < X or ans < N):
    D += L[ans - 1]
    ans += 1
    print(D, ans)
if D == X:
    print(ans)
else:
    print(ans - 1)

Buggy submission (verdict: Runtime Error):
N, X = (int(_) for _ in input().split())
L = list(map(int, input().split()))
D = 0
ans = 0
while (D < X or ans < N):
    D = D + L[ans]
    ans += 1
if D == X:
    print(ans)
else:
    print(ans - 1)
Problem p03044 (python)

Fixed submission:
import sys
sys.setrecursionlimit(9**9)
n=int(input())
C=[0 for _ in range(n)]
L=[[] for _ in range(n)]
for j in range(n-1):
  u,v,w=map(int,input().split())
  u-=1
  v-=1
  L[u].append([v,w])
  L[v].append([u,w])
def a(n,v,d):
  for i in L[n]:
    if d%2==1:C[n]=1
    if v!=i[0]:a(i[0],n,d+i[1])
a(0,0,0)
for c in C:print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n<2:
    print(1)
    exit()
A=[[] for _ in range(n)]
B=[0 for _ in range(n)]
for i in range(n-1):
    u,v,w=map(int,input().split())
    u-=1
    v-=1
    A[u].append([v,w,0])
    A[v].append([u,w,0])
def s(x):
    for i,a in enumerate(A[x]):
        if a[2]==0:
            if a[1]%2==0:B[a[0]]=B[x]
            else:B[a[0]]=B[x]^1
            A[x][i][2]=1
            for j,z in enumerate(A[a[0]]):
                if z[0]==x:A[a[0]][j][2]=1
            return s(a[0])
s(0)
for i in range(n):
    for a in A[i]:
        if a[2]==0:s(i)
for b in B:print(b)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n<2:
    print(1)
    exit()
A=[[] for _ in range(n)]
B=[0 for _ in range(n)]
for i in range(n-1):
    u,v,w=map(int,input().split())
    u-=1
    v-=1
    A[u].append([v,w,0])
    A[v].append([u,w,0])
def s(x):
    for i,a in enumerate(A[x]):
        if a[2]<1:
            if a[1]%2<1:B[a[0]]=B[x]
            else:B[a[0]]=B[x]^1
            A[x][i][2]=1
            for j,z in enumerate(A[a[0]]):
                if z[0]==x:A[a[0]][j][2]=1
            return s(a[0])
s(0)
for b in B:print(b)
Problem p03085 (python)

Fixed submission:
b = input()
if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "G":
  print("C")
elif b == "C":
  print("G")

Buggy submission (verdict: Runtime Error):
b = input():
if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "G":
  print("C")
elif b == "C":
  print("G")

Buggy submission (verdict: Runtime Error):
b = input():
if b == "A":
  print("T")
elif b = "T":
  print("A")
elif b = "G":
  print("C")
elif v = "C":
  print("G")

Buggy submission (verdict: Runtime Error):
b = input();
if b == "A":
  print("T")
elif b = "T":
  print("A")
elif b = "G":
  print("C")
elif v = "C":
  print("G")
Problem p03087 (python)

Fixed submission:
n,q=map(int,input().split())
s=input()
count=[0]*n
for i in range(1,n):
    count[i]+=count[i-1]
    if s[i-1:i+1]=="AC":
        count[i]+=1
for i in range(q):
    l,r=map(int,input().split())
    print(count[r-1] - count[l-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
count=[0]*n
for i in range(1,n):
    count[i]+=count[i-1]
    if s[i-1:i+1]=="AC":
        count[i]+=1
for i in range(n):
    l,r=map(int,input().split())
    print(count[r-1] - count[l-1])
Problem p03106 (python)

Fixed submission:
A, B, K = map(int, input().split())
D = []
for i in range(max(A, B), 0, -1):
  if A % i == 0 and B % i == 0:
    D.append(i)
print(D[K - 1])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
D = []
for i in range(max(A, B), 1, -1):
  if A % i == 0 and B % i == 0:
    D.append(i)
print(D[K - 1])
Problem p03136 (python)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
if max(L) * 2 < sum(L):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
L = map(int, input().split())
if max(L) * 2 < Sum(L):
  print("Yes")
else:
  print("No")
Problem p03146 (python)

Fixed submission:
s=int(input())
l=[]
while(s not in l):
  l.append(s)
  if s%2==0:s//=2
  else:s=s*3+1
print(len(l)+1)

Buggy submission (verdict: Runtime Error):
s=int(input())
l=[]
while(s not in 1):
  l.append(s)
  if s%2==0:s//=2
  else:s=s*3+1
print(len(l)+1)

Buggy submission (verdict: Runtime Error):
s=int(input())
l=[]
while(s not in 1):
  l.append(s)
  if s%2==0:s//=2
  else:s=s*3+1
print(len(l)+1)

Buggy submission (verdict: Runtime Error):
s=int(input())
l=[]
while(S not in 1):
  l.append(s)
  if s%2==0:s//=2
  else: s=s*3+1
print(len(l)+1)

Buggy submission (verdict: Runtime Error):
s=int(input())
l=[]
while(S not in 1):
  l.append(s)
  if s%2==0:s//=2
  else s=s*3+1
print(len(l)+1)
Problem p03196 (python)

Fixed submission:
n,p=map(int,input().split())
for i in range(int(p**(1/n)+(p>n**2)),0,-1):
  if p%i**n==0:exit(print(i))

Buggy submission (verdict: Runtime Error):
n,p=map(int,input().split())
for i in range(int(p**(1/n)+1)):
  if p%i**n==0:exit(print(i))
Problem p03210 (python)

Fixed submission:
print("YES" if input() in "753" else "NO")

Buggy submission (verdict: Runtime Error):
print("YES" if input() in 753 else "NO")
Problem p03244 (python)

Fixed submission:
from collections import Counter
n=int(input())
V=list(map(int,input().split()))
E=Counter(V[::2]).most_common()
O=Counter(V[1::2]).most_common()
if E[0][0]==O[0][0]:
	E2=Counter(V[1::2]).most_common()[1][1] if len(E)>1 else 0
	O2=Counter(V[::2]).most_common()[1][1] if len(O)>1 else 0 
print(n-E[0][1]-O[0][1] if E[0][0]!=O[0][0] else n-max(E[0][1]+E2,O[0][1]+O2))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n=int(input())
V=list(map(int,input().split()))
E=Counter(V[::2]).most_common()
O=Counter(V[1::2]).most_common()
E2=Counter(V[1::2]).most_common()[1][1] if len(E)>1 else 0
O2=Counter(V[::2]).most_common()[1][1] if len(O)>1 else 0 
print(n-E[0][1]-O[0][1] if E[0][0]!=O[0][0] else n-max(E[0][1]+E2,O[0][1]+O2))
Problem p03289 (python)

Fixed submission:
s=input()
print("AC" if (s[0]=="A") and ("C" in s[2:-1]) and (s[1:].replace("C","",1).islower()) else "WA")

Buggy submission (verdict: Runtime Error):
s=input()
print("AC" if s[0]=="A" and C in s[2:-1] and s[1:0].replace("C","c",1).islower() else "WA")
Problem p03309 (python)

Fixed submission:
from statistics import median as m
n=int(input())
A=list(map(int,input().split()))
B=sorted([A[i]-i-1 for i in range(n)])
mb=m(B)
print(int(sum([abs(b-mb) for b in B])))

Buggy submission (verdict: Runtime Error):
from statistics import median as m
n=int(input())
A=list(map(int,input().split()))
B=sorted([A[i]-i-1 for i in range(n)])
m(B)=mb
print(int(sum([abs(b-mb) for b in B])))
Problem p03338 (python)

Fixed submission:
n=int(input())
s=list(input())
ans=0
for i in range(1,n-1):
  ans=max(ans,len(set(s[:i])&set(s[i:])))
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s-list(input())
ans=0
for i in range(1,n-1):
  ans=max(ans,len(set(s[:i]|set(s[i:])))
print(ans)
Problem p03352 (python)

Fixed submission:
x=int(input())
c=1
for i in range(1,x):
  for j in range(2,x):
    if i**j<=x:
      c=max(c,i**j)
    else:
      break
print(c)

Buggy submission (verdict: Runtime Error):
x=int(input())
c=1
for i in range(1,x):
  for j in range(2,x):
    if b**j<=x:
      c=max(c,b**j)
    else:
      break
print(c)
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
s=range(a,b+1)
for i in sorted(set(s[:k])|set(s[-k:])):print(i)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
s=range(a+1,b+1)
for i in (sorted(s[:k]|s[k:]):print(i)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
s=range(a+1,b+1)
for i in (sorted(s[:k]|s[k:]):print(i)
Problem p03408 (python)

Fixed submission:
n=[input() for i in range(int(input()))]
m=[input() for i in range(int(input()))]
l=list(set(n))
print(max(0,max(n.count(l[i])-m.count(l[i]) for i in range(len(l)))))

Buggy submission (verdict: Runtime Error):
n=[input() for i in range(int(input()))]
m=[input() for i in range(int(input()))]
l=list(set(n))
print(max(0,max(n.count(l[i])-m.count(l[i]) for i in range(len(l))))

Buggy submission (verdict: Runtime Error):
n=[input() for i in range(int(input()))]
m=[input() for i in range(int(input()))]
l=list(set(n))
print(max(0,max(n.count(l[i])-m.count(l[i])) for i in range(len(l))))
Problem p03427 (python)

Fixed submission:
n=str(int(input())+1)
print(sum(map(int,list(str(int(n[0]+'0'*(len(n)-1))-1)))))

Buggy submission (verdict: Runtime Error):
n=str(int(input())+1)
print(sum(map(int,list(n[0]+[0]*(len(n)-1)))))
Problem p03435 (python)

Fixed submission:
r=range
M=[list(map(int,input().split())) for _ in r(3)]
for i in r(2):
  x=M[0][i]-M[0][i+1]
  y=M[i][0]-M[i+1][0]
  for j in r(3):
    if x!=M[j][i]-M[j][i+1] or y!=M[i][j]-M[i+1][j]:
      print('No')
      exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
r=range
M=[list(map(int,input().split())) for _ in r(3)]
for i in r(2):
  x=M[0][i]-M[0][i+1]
  y=M[i][0]-M[i+1][0]
  for j in r(3):
    if x!=M[j][i]-M[j][i+1] or y=M[i][j]-M[i+1][j]:
      print('No')
      exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
r=range
M=[list(map(int,input().split())) for _ in r(3)]
x
for i in r(2):
  x=M[0][i]-M[0][i+1]
  y=M[i][0]-M[i+1][0]
  for j in r(3):
    if x!=M[j][i]-M[j][i+1] or y=M[i][j]-M[i+1][j]:
      print('No')
      exit()
print('Yes')
Problem p03447 (python)

Fixed submission:
x,a,b=[int(input()) for i in range(3)]
print((x-a)%b)

Buggy submission (verdict: Runtime Error):
n,k,x,y=(int(input()) for i in [0]*4)
print(n*x-(x-y)*max(n-k,0))
Problem p03456 (python)

Fixed submission:
print("Yes" if int(input().replace(" ",""))**0.5%1==0 else "No")

Buggy submission (verdict: Runtime Error):
print("Yes" if int(input().replace(" ",""))**0.5%1==0 else "No)
Problem p03469 (python)

Fixed submission:
print("2018"+input()[4:])

Buggy submission (verdict: Runtime Error):
s=input()
s[3]='8'
print(s)
Problem p03470 (python)

Fixed submission:
print(len(set([int(input()) for i in range(int(input()))])))

Buggy submission (verdict: Runtime Error):
print(len(set([int(input()) for i in range(int(input()))]))
Problem p03474 (python)

Fixed submission:
a,b=input().split()
s=input()
print("Yes" if s[int(a)]=="-" and s.count("-")==1 else "No")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
s=input()
print("Yes" if s[a]=="_" and s.count("_")==1 else "No")
Problem p03477 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
print("Left" if a+b>c+d else "Right" if a+b<c+d else "Balanced")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input(),split())
print("Left" if a+b>c+d else "Right" if a+b<c+d else "Balanced")
Problem p03485 (python)

Fixed submission:
print(-(-eval(input().replace(" ","+"))//2))

Buggy submission (verdict: Runtime Error):
print(-(-eval(input().replace(" ","+")//2))
Problem p03495 (python)

Fixed submission:
from collections import Counter
n,k=map(int,input().split())
A=sorted(Counter(list(map(int,input().split()))).most_common(),key=lambda x:x[1],reverse=True)
print(n-sum([A[i][1] for i in range(min(k,len(A)))]))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n,k=map(int,input().split())
A=sorted(Counter(list(map(int,input().split()))).most_common())
print(n-sum([A[i][1] for i in range(k)]))
Problem p03543 (python)

Fixed submission:
n = input()
print("Yes" if n[0]==n[1]==n[2] or n[1]==n[2]==n[3] else "No")

Buggy submission (verdict: Runtime Error):
n = input
print("Yes" if n[0] == n[1] == n[2] or n[1] == n[2] == n[3] else "No")

Buggy submission (verdict: Runtime Error):
n = input
print("Yes" if n[0] == n[1] == n[2] or n[1] == n[2] == n[3] 
      else "No")
Problem p03544 (python)

Fixed submission:
a,b=2,1
for i in range(int(input())):a,b=b,a+b
print(a)

Buggy submission (verdict: Runtime Error):
a,b=2,1
for i in range(int(input()):a,b=b,(a+b)
print(a)
Problem p03546 (python)

Fixed submission:
from networkx import *
h,w=map(int,input().split())
G=DiGraph()
G.add_nodes_from(range(10))
C=[[*map(int,input().split())]for _ in "_"*10]
G.add_weighted_edges_from([(i,j,C[i][j])for i in range(10)for j in range(10)])
S=[single_source_dijkstra_path_length(G,i)[1]for i in range(10)]
A=[[*map(int,input().split())]for _ in "_"*h]
print(sum(S[abs(x)] for a in A for x in a))

Buggy submission (verdict: Runtime Error):
from networkx import *
h,w=map(int,input().split());r=range(10);G=DiGraph();G.add_nodes_from(r);C=[[*map(int,input().split())]for _ in "_"*10];G.add_weighted_edges_from([(i,j,C[i][j])for i in r for j in r]);S=[single_source_dijkstra_path_length(G,i)[1]for i in r];A=[[*map(int,input().split())]for _ in r];print(sum(S[abs(x)] for a in A for x in a))
Problem p03547 (python)

Fixed submission:
x,y=input().split()
print("<" if x<y else "=" if x==y else ">")

Buggy submission (verdict: Runtime Error):
x,y=input().split()
print("<" if x<y else "=" if x==y else">)
Problem p03563 (python)

Fixed submission:
print(-int(input())+int(input())*2)

Buggy submission (verdict: Runtime Error):
print(-int(input()+int(input())*2)
Problem p03574 (python)

Fixed submission:
h,w=map(int,input().split())
s=[input() for i in range(h)]
for i in range(h):
  l=""
  for j in range(w):
    if s[i][j]=="#":
      l+="#"
    else:
      l+=str(sum(t[max(0,j-1):min(w,j+2)].count("#") for t in s[max(0,i-1):min(h,i+2)]))
  print(l)

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[input() for i in range(h)]
for i in range(h):
  l=""
  for j in range(w):
    if s[i][j]=="#":
      l+="#"
    else:
      l+=str(sum(t[max(0,j-1):min(w,j+2)].count("#") for t in t[max(0,i-1):min(h,i+2)]))
    print(l)
Problem p03576 (python)

Fixed submission:
n,k=map(int,input().split())
P=[list(map(int,input().split())) for _ in range(n)]
X=sorted(list(map(lambda x:x[0],P)))
Y=sorted(list(map(lambda x:x[1],P)))
s=(X[0]-X[-1])*(Y[0]-Y[-1])
ans=0
for r in range(n-1,0,-1):
  for l in range(r):
    for u in range(n-1,0,-1):
      for b in range(u):
        c=0
        for p in P:
          if X[l]<=p[0]<=X[r] and Y[b]<=p[1]<=Y[u]:
            c+=1
        if c>=k:
          s=min(s,(X[r]-X[l])*(Y[u]-Y[b]))
        else:break
    if u==n-1 and b==0 and c<k:
      break
print(s)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
P=[list(map(int,input().split())) for _ in range(n)]
X=sorted(list(map(lambda x:x[0],P)))
Y=sorted(list(map(lambda x:x[1],P)))
s=(X[0]-X[-1])*(Y[0]-Y[-1])
ans=0
for r in range(1,n):
  for l in range(r):
    if c<k:
      break
    for u in range(1,n):
      for b in range(u):
        c=0
        for p in P:
          if X[l]<=p[0]<=X[r] and Y[b]<=p[1]<=Y[u]:
            c+=1
        if c>=k:
          s=min(s,(X[r]-X[l])*(Y[u]-Y[b]))
        else:break
print(s)
Problem p03607 (python)

Fixed submission:
n=int(input())
s=set()
for i in range(n):
  s^={input()}
print(len(s))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=set()
for i in range(n):
  s^=input()
print(len(s))
Problem p03611 (python)

Fixed submission:
input()
C=[0]*100002
for i in map(int,input().split()):
  C[i-1]+=1
  C[i]+=1
  C[i+1]+=1
print(max(C))

Buggy submission (verdict: Runtime Error):
C=[0]*100002
for i in map(int,input().split()):
  C[i-1],C[i],C[i+1]+=1
print(max(C))
Problem p03612 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))+[0]
c=0
for i in range(n):
  j=i+1
  a=A[i]
  if a==j:
    c+=1
    A[i]=A[i+1]
    A[i+1]=j
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
c=0
for i,a in enumerate(A):
  i+=1
  if i*a==1:
    c+=1
    A[0]=A[1]
    A[1]=1
  elif i==a:
    c+=1
    A[i]=A[i-1]
    A[i-1]=i
print(c)
Problem p03636 (python)

Fixed submission:
a,*b,c=input()
print(a+str(len(b))+c)

Buggy submission (verdict: Runtime Error):
a,*b,c=input()
print(a+str(len(b))+C)

Buggy submission (verdict: Runtime Error):
a,*b,c=input()
print(a+len(b)+C)
Problem p03640 (python)

Fixed submission:
h,w,n,*A=map(int,open(0).read().split());c=[]
for i in range(1,n+1):c+=[i]*A[i-1]
for i in range(h):print(*(c[i*w:-~i*w])[::(-1)**i])

Buggy submission (verdict: Runtime Error):
h,w,n,*A=map(int,open(x:=0).read().split());c=[]
for i in range(n):c+=[i+1]*A[i]
for i in range(h):print(*(c[i*w:-~i*w])[::x]);x^=1
Problem p03644 (python)

Fixed submission:
print(2**(len(bin(int(input())))-3))

Buggy submission (verdict: Runtime Error):
print(2**(len(bin(int(input())))-3)
Problem p03657 (python)

Fixed submission:
a,b=map(int,input().split())
print("Possible" if any([a%3==0,b%3==0,(a+b)%3==0]) else "Impossible")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print("Possible" iaf any([a%3==0,b%3==0,(a+b)%3==0]) else "Impossible")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print("Possible" if any(a%3==0,b%3==0,(a+b)%3==0) else "Impossible")
Problem p03658 (python)

Fixed submission:
n,k=map(int,input().split())
l=list(map(int,input().split()))
print(sum(sorted(l)[::-1][:k]))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=list(map(int,inout().split()))
print(sum(sorted(l)[:k][::-1]))
Problem p03673 (python)

Fixed submission:
N=int(input())
A=list(input().split())
print(" ".join(A[::-2] + A[N%2::2]))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
print(*a[::-2],*a[n%2::-2])
Problem p03680 (python)

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
c,s=1,a[0]
while s!=2 and c<n:
  c,s=c+1,a[s-1]
print(c if c<n else -1)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for i in range(n)]
c,s=1,a[0]
while S!=2 and c<n:
  c,s=c+1,a[s-1]
print(c if c<n else -1)
Problem p03693 (python)

Fixed submission:
print("YES" if int(input().replace(" ",""))%4==0 else "NO")

Buggy submission (verdict: Runtime Error):
print("YES" if int(input().replace(" ",""))%4==0 else "NO)

Buggy submission (verdict: Runtime Error):
print("YES" if int(input().replace(" ","")%4==0 else "NO)
Problem p03730 (python)

Fixed submission:
a,b,c=map(int,input().split())
print("YES" if any((a*i)%b==c for i in range(1,b+1)) else "NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int(input()))
print("YES" if any((a*i)%b==c for i in range(a,b+1)) else "NO")