Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

n = int(input())
v = list(map(int, input().split(' ')))

odd = defaultdict(int)
even = defaultdict(int)
al = defaultdict(int)

for i in range(len(v)):
  al[v[i]] += 1
  if(i % 2 == 0): # even
    even[v[i]] += 1
  else: # odd
    odd[v[i]] += 1

if(len(al) == 1):
  print(int(n / 2))
  exit()

even_sorted = sorted(even.items(), key=lambda x: x[1], reverse=True)
odd_sorted = sorted(odd.items(), key=lambda x: x[1], reverse=True)

#print(even_sorted)
#print(odd_sorted)

if(len(even_sorted) == 1): # what if either of them had only one uniq num..
  if(odd_sorted[0][0] == even_sorted[0][0]):
    print(n - odd_sorted[1][1]  - even_sorted[0][1])
  else:
    print(n - odd_sorted[0][1] - even_sorted[0][1])
elif(len(odd_sorted) == 1):
  if(odd_sorted[0][0] == even_sorted[0][0]):
    print(n - even_sorted[1][1] - odd_sorted[0][1])
  else:
    print(n - odd_sorted[1][1] - even_sorted[0][1])


else: # both of them have more than 1 uniq num..
  if(odd_sorted[0][0] == even_sorted[0][0]):
    if(odd_sorted[0][1] < even_sorted[0][1]): # odd to be changed (even stays)
      print(n - odd_sorted[1][1] - even_sorted[0][1])
    else:
      print(n - odd_sorted[0][1] - even_sorted[1][1])
  else: # both has more than 1 uniq num, and most freq values aren't the same
    print(n - odd_sorted[0][1] - even_sorted[0][1])



Fixed submission:
from collections import defaultdict

n = int(input())
v = list(map(int, input().split(' ')))

odd = defaultdict(int)
even = defaultdict(int)
al = defaultdict(int)

for i in range(len(v)):
  al[v[i]] += 1
  if(i % 2 == 0): # even
    even[v[i]] += 1
  else: # odd
    odd[v[i]] += 1

if(len(al) == 1):
  print(n // 2)
  exit()

even_sorted = sorted(even.items(), key=lambda x: x[1], reverse=True)
odd_sorted = sorted(odd.items(), key=lambda x: x[1], reverse=True)

#print(even_sorted[0:4])
#print(odd_sorted[0:4])


if(len(even_sorted) == 1): # what if either of them had only one uniq num..
  if(odd_sorted[0][0] == even_sorted[0][0]):
    print(n - odd_sorted[1][1]  - even_sorted[0][1])
  else:
    print(n - odd_sorted[0][1] - even_sorted[0][1])
elif(len(odd_sorted) == 1):
  if(odd_sorted[0][0] == even_sorted[0][0]):
    print(n - even_sorted[1][1] - odd_sorted[0][1])
  else:
    print(n - odd_sorted[0][1] - even_sorted[0][1])


else: # both of them have more than 1 uniq num..
  if(odd_sorted[0][0] == even_sorted[0][0]):
    if(odd_sorted[0][1] == even_sorted[0][1]):
      if(odd_sorted[1][1] < even_sorted[1][1]):
        print(n - odd_sorted[0][1] - even_sorted[1][1])
      else:
        print(n - odd_sorted[1][1] - even_sorted[0][1])
    elif(odd_sorted[0][1] < even_sorted[0][1]): # odd to be changed (even stays)
      print(n - odd_sorted[1][1] - even_sorted[0][1])
    else:
      print(n - odd_sorted[0][1] - even_sorted[1][1])
  else: # both has more than 1 uniq num, and most freq values aren't the same
    print(n - odd_sorted[0][1] - even_sorted[0][1])
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

cnt = np.zeros((N,N))

for x in map(str,range(1,N+1)):
    cnt[int(x[0]),int(x[-1])] += 1

ans = 0
for i in range(1,10):
    for j in range(1,10):
        ans += cnt[i,j] * cnt[j,i]

print(int(ans))

Fixed submission:
N = int(input())

cnt = [[0] * 10 for _ in range(10)]

for i in range(1,N+1):
    x = i
    while x >= 10:
        x //= 10
    cnt[x][i%10] += 1

ans = 0
for i in range(1,10):
    for j in range(1,10):
        ans += cnt[i][j] * cnt[j][i]

print(ans)
Buggy python submission (verdict: Runtime Error):
# レベルLのN番目
def solve(L,N):
    if L == 0 and N == 1:
        return 1
    if N == 1:
        return 0
    elif N <= 2**(L+1)-2:
        return solve(L-1,N-1)
    elif N == int(2**(L+1)-1):
        return 2**L
    return solve(L-1,N-2**(L+1)+1) + 2**L

N,X = map(int,input().split())
print(solve(N,X))

Fixed submission:
# レベルLのN番目
def solve(L,N):
    if L == 0:
        return 1
    if N == 1:
        return 0
    elif N <= 2**(L+1)-2:
        return solve(L-1,N-1)
    elif N == int(2**(L+1)-1):
        return 2**L
    return solve(L-1,N-2**(L+1)+1)+2**L
    

N,X = map(int,input().split())
print(solve(N,X))

Buggy python submission (verdict: Runtime Error):
# レベルLのN番目
def solve(L,N):
    if L == 0 and N == 1:
        return 1
    if N == 1:
        return 0
    elif N <= 2**(L+1)-2:
        return solve(L-1,N-1)
    elif N == int(2**(L+1) - 1):
        return 2**L
    return solve(L-1,N-2**(L+1)+1) + 2**L

N,X = map(int,input().split())
print(solve(N,X))

Fixed submission:
# レベルLのN番目
def solve(L,N):
    if L == 0:
        return 1
    if N == 1:
        return 0
    elif N <= 2**(L+1)-2:
        return solve(L-1,N-1)
    elif N == int(2**(L+1)-1):
        return 2**L
    return solve(L-1,N-2**(L+1)+1)+2**L
    

N,X = map(int,input().split())
print(solve(N,X))
Buggy python submission (verdict: Runtime Error):
n=int(input)
L=[int(i) for i in input().split()]
count=0
for i in range(1,n+1,2):
  if(L[i-1]%2==0):
    count+=1
print(count)
  

Fixed submission:
n=int(input())
L=[int(i) for i in input().split()]
count=0
for i in range(1,n+1,2):
  if(L[i-1]%2!=0):
    count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
n=int(input)
L=[i for i in input().split()]
count=0
for i in range(1,n+1,2):
  if(L[i-1]%2==0):
    count+=1
print(count)
  


Fixed submission:
n=int(input())
L=[int(i) for i in input().split()]
count=0
for i in range(1,n+1,2):
  if(L[i-1]%2!=0):
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
L=[int(x) for x in input().split(" ")
print(L.index(0)+1)

Fixed submission:
L=[int(x) for x in input().split(" ")]
print(L.index(0)+1)
Buggy python submission (verdict: Runtime Error):
d,t,s == map(int, input().split())

tmp = d/s

if tmp <= t:
    print("Yes")
else:
    print("No")

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

tmp = d/s

if tmp <= t:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
print(ord_s.swapcase)

Fixed submission:
s = input()

if s.isupper():
    print("A")
else:
    print("a")
Buggy python submission (verdict: Runtime Error):
for num in range(0, 5, 1):
    x = int(input())
    if x == 0:
        print(num + 1)
        exit()

Fixed submission:
line = list(map(int, input().split()))
cnt = 1
for num in line:
    if num == 0:
        print(cnt)
        exit()

    cnt+=1
Buggy python submission (verdict: Runtime Error):
zzz

Fixed submission:
N = input()

N = int(N[-1])

if N == 0 or N == 1  or N == 6  or N == 8 :
    print("pon")
elif N == 3:
    print("bon")
else:
    print("hon")

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

N = int(N[-1])

if N == 0 or N == 1  or N == 6  or N == 8 :
    print("pon")
elif N == 3:
    print("bon")
else:
    print("hon")

Fixed submission:
N = input()

N = int(N[-1])

if N == 0 or N == 1  or N == 6  or N == 8 :
    print("pon")
elif N == 3:
    print("bon")
else:
    print("hon")
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

n = int(input())

cnt = 0

for i in range(n):
    i +=1
    for j in range(n):
        j +=1
        for k in range(n):
            k +=1

            cnt += gcd(i,j,k)

print(cnt)


Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

n = int(input())

cnt = 0

for i in range(n):
    i +=1
    for j in range(n):
        j +=1
        for k in range(n):
            k +=1

            cnt += gcd(i,j,k)

print(cnt)
Buggy python submission (verdict: Runtime Error):
s,t =input().split()
a,b = map(int, input().split())
u = input()


a = 123
b = 'abc'

print(f'{a} and {b}')
# print(f'{s} {t}')

# if s == u:
#     a-=1
#     print(f'{a} {b}')
# else:
#     b-=1
#     print(f'{a} {b}')


Fixed submission:
s,t =input().split()
a,b = map(int, input().split())
u = input()


if u == s:
    print(a-1, b)
elif u == t:
    print(a, b-1)

Buggy python submission (verdict: Runtime Error):
s,t =input().split()
a,b = map(int, input().split())
u = input()

print(f'{s} {t}')

# if s == u:
#     a-=1
#     print(f'{a} {b}')
# else:
#     b-=1
#     print(f'{a} {b}')


Fixed submission:
s,t =input().split()
a,b = map(int, input().split())
u = input()


if u == s:
    print(a-1, b)
elif u == t:
    print(a, b-1)

Buggy python submission (verdict: Runtime Error):
s,t =input().split()
a,b = map(int, input().split())
u = input()

print(f'{a} {b}')

# if s == u:
#     a-=1
#     print(f'{a} {b}')
# else:
#     b-=1
#     print(f'{a} {b}')


Fixed submission:
s,t =input().split()
a,b = map(int, input().split())
u = input()


if u == s:
    print(a-1, b)
elif u == t:
    print(a, b-1)

Buggy python submission (verdict: Runtime Error):
s,t =input().split()
a,b = map(int, input().split())
u = input()

if s == u:
    a-=1
    print(f'{a} {b}')
else:
    b-=1
    print(f'{a} {b}')


Fixed submission:
s,t =input().split()
a,b = map(int, input().split())
u = input()


if u == s:
    print(a-1, b)
elif u == t:
    print(a, b-1)

Buggy python submission (verdict: Runtime Error):
s,t = input().split()
a,b = map(int, input().split())
u   = input()

if s == u:
    print(f'{a-1} {b}')
else:
    print(f'{a} {b-1}')


Fixed submission:
s,t =input().split()
a,b = map(int, input().split())
u = input()


if u == s:
    print(a-1, b)
elif u == t:
    print(a, b-1)

Buggy python submission (verdict: Runtime Error):
s,t =input().split()
a,b = map(int, input().split())
u = input()

if s == u:
    print(f'{a-1} {b}')
else:
    print(f'{a} {b-1}')


Fixed submission:
s,t =input().split()
a,b = map(int, input().split())
u = input()


if u == s:
    print(a-1, b)
elif u == t:
    print(a, b-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s,t = input().split()

out = ""

for i in range(2):
    out += s[i]
    out += t[i]

print(out)

Fixed submission:
n = int(input())
s,t = input().split()

# n = int(2)
# s,t = "ip cc".split()

out = ""

for i in range(n):
    out += s[i]
    out += t[i]

print(out)

Buggy python submission (verdict: Runtime Error):
n = input()
s,t = input().split()

out = ""

for i in range(2):
    out += s[i]
    out += t[i]

print(out)

Fixed submission:
n = int(input())
s,t = input().split()

# n = int(2)
# s,t = "ip cc".split()

out = ""

for i in range(n):
    out += s[i]
    out += t[i]

print(out)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()

if s >= 3200:
    print(s)
else:
    print("red")

Fixed submission:
a = int(input())
s = input()


if a >= 3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
a,p = map(int, input().split())

cnt = a * 3

print(int(cnt/p))

Fixed submission:
a,p = map(int, input().split())

# a,p = map(int, "1 3".split())


cnt = a * 3 + p

print(int(cnt/2))
Buggy python submission (verdict: Runtime Error):
s = int(input())

# s = "2019/11/01"
yyyy = int(s[0:4])
mm = int(s[5:7])
dd = int(s[8:10])


if yyyy >= 2019 and mm >= 5:
    print("TBD")
else:
    print("Heisei")

Fixed submission:
s = input()

# s = "2019/11/01"
yyyy = int(s[0:4])
mm = int(s[5:7])
dd = int(s[8:10])


if yyyy >= 2019 and mm >= 5:
    print("TBD")
else:
    print("Heisei")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())

print(int(a*B/2))

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

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

if k%2 ==0:
    print((k/2)*(k/2))
else:
    print(((k-1)/2)*((k+1)/2))


Fixed submission:
k = int(input())


if k%2 ==0:
    print(int((k/2)*(k/2)))
else:
    print(int(((k-1)/2)*((k+1)/2)))

Buggy python submission (verdict: Runtime Error):
k = input()

if k%2 ==0:
    print((k/2)**2)
else:
    print(((k-1)/2)*((k+1)/2))


Fixed submission:
k = int(input())


if k%2 ==0:
    print(int((k/2)*(k/2)))
else:
    print(int(((k-1)/2)*((k+1)/2)))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())

print(a*b a-b)

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

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

# lines = list(map(int, "1 6 3".split()))
lines.sort()

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

print(lines[2]-lines[1] + lines[1]-lines[0]  )



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

# lines = list(map(int, "1 6 3".split()))
lines.sort()

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

print(lines[2]-lines[1] + lines[1]-lines[0]  )

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

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

print(cnt)



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

# lines = list(map(int, "1 6 3".split()))
lines.sort()

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

print(lines[2]-lines[1] + lines[1]-lines[0]  )
Buggy python submission (verdict: Runtime Error):
s = input()

cnt = s.count('o')

print(s + 100 * cnt)

Fixed submission:
s = input()

cnt = s.count('o')

print(700 + 100 * cnt)
Buggy python submission (verdict: Runtime Error):
s = input()

s = sorted()

if s == "abc":
    print("Yes")
else:
    print("No")

Fixed submission:
s = input()
s = sorted(s)

if ''.join(s) == "abc":
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = int(input())

print(s[0:3] + '8' +s[4:10] )

Fixed submission:
s = input()


print(s[0:3] + '8' +s[4:10] )
Buggy python submission (verdict: Runtime Error):
import pip._internal.models.target_python

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

print(math.ceil((a+b)/2))

Fixed submission:
import math
a, b = map(int, input().split())

print(math.ceil((a+b)/2))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())

if ord(a) < ord(b):
    print("<")
elif ord(a) > ord(b):
    print(">")
else:
    print("=")

Fixed submission:
a,b = input().split()

if ord(a) < ord(b):
    print("<")
elif ord(a) > ord(b):
    print(">")
else:
    print("=")
Buggy python submission (verdict: Runtime Error):
N = int(input())

if N[0] == N[2]:
    print("Yes")
else:
    print("No")

Fixed submission:
N = input()

if N[0] == N[2]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
line = list(map(int,intput().split()))
line.sort()

print(line[0] + line[1])

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

print(line[0] + line[1])

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

print(line[0] + line[1])


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

print(line[0] + line[1])
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int, input().split())

# a,b,x = map(int, "0 5 1".split())
cnt=0
for num in range(a, b+1, 1):

    if num % x == 0:
        cnt+=1
print(cnt)

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

# a,b,x = map(int, "9 9 2".split())
cnt=0

alfa = b//x + 1
beta = (a-1)//x + 1

print(alfa - beta)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int, input().split())

cnt=0
for num in range(a, b+1, 1):

    if num % x == 0:
        cnt+=1
print(cnt)

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

# a,b,x = map(int, "9 9 2".split())
cnt=0

alfa = b//x + 1
beta = (a-1)//x + 1

print(alfa - beta)
Buggy python submission (verdict: Runtime Error):
N = int(input())

t = [0]
x = [0]
y = [0]
for i in range(N):
    l = [int(c) for c in input().split()]
    t.append(l[0])
    x.append(l[1])
    y.append(l[2])

for i in range(N-1):
    move = x[i+1]-x[i] + y[i+1]-y[i]
    time = t[i+1]-t[i]
    if time%2 ^ move%2 == 1 or time < move:
        print("No")
        exit()

print("Yes")


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

a = n[0]
b = n[1]

if (a % 2 == 0) or (b % 2 == 0):
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
N=int(input())
list1=[]
for i in range(N):
  x1=list(map(int,input().split()))
  list1.append(x1)
flag=0
for i in range(101):
  for j in range(101):
    list2=[]
    for k in range(N):
      Hx=list1[k][2]+abs(list1[k][0]-i)+abs(list1[k][1]-j)
      list2.append(Hx)
    if len(set(list2))==1:
      list3=[0]
      for l in range(N):
         d=Hx-abs(list1[l][0]-i)-abs(list1[l][1]-j)
         list3.append(d)
      if min(list3)>=0:
         print(i,j,Hx)
         flag=1
      else:
        pass
    else:
      pass
    if flag==1:
      break
  if flag==1:
    break

Fixed submission:
n=int(input())
if n==1:
  print('Hello World')
else:
  A=int(input())
  B=int(input())
  print(A+B)
Buggy python submission (verdict: Runtime Error):
import random
s=list(input())
t=list(input())
random.shuffle(s)
random.shuffle(t)
S=''.join(s)
T=''.join(t)
L=[S,T]
L.sort()
if T==S:
  print('No')
elif L[0]==S:
  print('Yes')
elif L[0]==T:
  print('No')



Fixed submission:
a,b=map(int,input().split())
x=(a+b)/2
if int(x)==x:
   print(int(x))
else :
   print(int(x)+1)
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
s.sort()
T=t.sort()[::-1]
L=sort([s,T])

if s==T:
  print('No')
else:
  if L[0]==s:
    print('Yes')
  else:
    print('No')

Fixed submission:
s=list(input())
t=list(input())
S=''.join(sorted(s))
T=''.join(sorted(t)[::-1])
L=sorted([S,T])

if S==T:
  print('No')
else:
  if L[0]==S:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
A.sort()
A.append(200001)
for i in range(N):
  if A[i]==A[i+1]:
    continue
  else:
    x=A.count(A[i])
    L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)

Fixed submission:
S1,S2,S3=map(int,input())
print(S1+S2+S3)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
flag=0

for x in range(100):
  for y in range(N):
    if  A[y]%2==0:
      A[y]=A[y]/2    
    else:
      print(x)
      flag=1
      break
  if flag==1:
    break



Fixed submission:
S1,S2,S3=map(int,input())
print(S1+S2+S3)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
flag=0

for x in range(100):
  for y in range(N):
    if  A[y]%2==0:
      A[y]=A[y]/2    
    else:
      print(x)
      flag=1
      break
  if flag==1:
    break



Fixed submission:
S1,S2,S3=map(int,input())
print(S1+S2+S3)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
A.sort()
A.append(200001)
for i in range(N):
  if A[i]==A[i+1]:
    continue
  else:
    x=A.count(A[i])
    L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
flag=0

for x in range(30):
  for y in range(N):
    if  A[y]%2==0:
      A[y]=A[y]/2    
    else:
      print(x)
      flag=1
      break
  if flag==1:
    break
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(K):
  s+=l[i][1]
  
print(N-s)

Fixed submission:
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(len(l)):
  s+=l[i][1]
  
print(N-s)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
B=set(A)
for i in B:
  x=A.count(i)
  L.append(x)
L.sort(reverse=True)
S=sum(L[0:K:1])
print(N-S)

Fixed submission:
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(len(l)):
  s+=l[i][1]
  
print(N-s)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
B=set(A)
for i in B:
  x=A.count(i)
  L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)

Fixed submission:
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(len(l)):
  s+=l[i][1]
  
print(N-s)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
A.sort()
A.append(200001)
for i in range(N):
  if A[i]==A[i+1]:
    continue
  else:
    x=A.count(A[i])
    L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)

Fixed submission:
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(len(l)):
  s+=l[i][1]
  
print(N-s)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
A.sort()
A.append(200001)
for i in range(N):
  if A[i]==A[i+1] or i==N-1:
    continue
  else:
    x=A.count(A[i])
    L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)

Fixed submission:
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(len(l)):
  s+=l[i][1]
  
print(N-s)
Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())
count=0
for X in range(K+1):
  for Y in range(K+1):
    for Z in range(K+1):
      if X+Y+Z==S:
        count+=1
      else:
        continue
        
print(count)

Fixed submission:
K,S=map(int,input().split())
count=0
for X in range(K,-1,-1):
  if S-X>2*K:
    break    
  for Y in range(K,-1,-1):
    if 0<=S-(X+Y)<=K:
       count+=1
    elif 0>S-(X+Y):
       continue
    else:    
       break
print(count)
Buggy python submission (verdict: Runtime Error):
w,h,n=map(int,input().split())
xa=[]
xb=[]
ya=[]
yb=[]
for i in range(n):
  x1,y1,a1=map(int,input().split())
  if a1==1:
    xa.append(x1)
  elif a1==2:
    xb.append(x1)
  elif a1==3:
    ya.append(y1)
  elif a1==4:
    yb.append(y1)

if min(xb)<=max(xa) or min(yb)<=max(ya):
  print(0)
else:
  print((min(xb)-max(xa))*(min(yb)-max(ya)))

Fixed submission:
w,h,n=map(int,input().split())
xa=[0]
xb=[w]
ya=[0]
yb=[h]
for i in range(n):
  x1,y1,a1=map(int,input().split())
  if a1==1:
    xa.append(x1)
  elif a1==2:
    xb.append(x1)
  elif a1==3:
    ya.append(y1)
  elif a1==4:
    yb.append(y1)

if min(xb)<=max(xa) or min(yb)<=max(ya):
  print(0)
else:
  print((min(xb)-max(xa))*(min(yb)-max(ya)))

Buggy python submission (verdict: Runtime Error):
w,h,n=map(int,input().split())
xa=[]
xb=[]
ya=[]
yb=[]
for i in range(n):
  x1,y1,a1=map(int,input().split())
  if a1==1:
    xa.append(x1)
  elif a1==2:
    xb.append(x1)
  elif a1==3:
    ya.append(y1)
  elif a1==4:
    yb.append(y1)

if max(xb)<=max(xa) or max(yb)<=max(ya):
  print(0)
else:
  print((max(xb)-max(xa))*(max(yb)-max(ya)))

Fixed submission:
w,h,n=map(int,input().split())
xa=[0]
xb=[w]
ya=[0]
yb=[h]
for i in range(n):
  x1,y1,a1=map(int,input().split())
  if a1==1:
    xa.append(x1)
  elif a1==2:
    xb.append(x1)
  elif a1==3:
    ya.append(y1)
  elif a1==4:
    yb.append(y1)

if min(xb)<=max(xa) or min(yb)<=max(ya):
  print(0)
else:
  print((min(xb)-max(xa))*(min(yb)-max(ya)))
Buggy python submission (verdict: Runtime Error):
L,N=map(int,input().split())
l=[]
for i in range(N):
  l.append(input())
  
l.sort()
print(''.join(l))


Fixed submission:
N,L=map(int,input().split())
l=[]
for i in range(N):
  l.append(input())
  
l.sort()
print(''.join(l))

Buggy python submission (verdict: Runtime Error):
L,N=map(int,input().split())
l=[]
for i in range(N):
  s=list(input())
  s.sort()
  a=''.join(s)
  l.append(a)
  
l.sort()
print(''.join(l))


Fixed submission:
N,L=map(int,input().split())
l=[]
for i in range(N):
  l.append(input())
  
l.sort()
print(''.join(l))
Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
flag = 0
for i in range (100):
  for j in range (100):
    if ((i+j == x) and(2*i+4*j == y))  :
      print("Yes")
      flag = 1
if flag == 0:
print("No")

Fixed submission:
x,y = map(int,input().split())
flag = 0
for i in range (100):
  for j in range (100):
    if ((i+j == x) and(2*i+4*j == y)):
      print("Yes")
      flag = 1
if (flag == 0):
    print("No")