Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())

def quicksort_reverse(lst):
    if len(lst) < 2:
        return lst
    else:
        less = []
        more = []
        pivot = lst[0]
        for i in range(1,len(lst)):
            if lst[i] < pivot:
                less.append(lst[i])
            else:
                more.append(lst[i])
        return quicksort_reverse(more) + [pivot] + quicksort_reverse(less)

arr = list(map(int,input().split()))
arr = quicksort_reverse(arr)

to_multiply = []
while len(to_multiply) < 2 and len(arr) > 1:
    if arr[0] == arr[1]:
        to_multiply.append(arr[0])
    arr = arr[2:]
if len(to_multiply) == 2:
    print(to_multiply[0] * to_multiply[1])
else:
    print("0")


Fixed submission:
N = int(input())
freq = {}
arr = map(int,input().split())
for i in arr:
    try:
        freq[i] += 1
    except KeyError:
        freq[i] = 1

to_multiply = []      
for i in sorted(freq.keys(),reverse=True):
    if freq[i] >= 4:
        to_multiply.append(i)
        to_multiply.append(i)
    elif freq[i] >= 2:
        to_multiply.append(i)
if len(to_multiply) >= 2:
    print(to_multiply[0] * to_multiply[1])
else:
    print("0")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

arr = map(int,input().split())
arr = sorted(arr,reverse=True)

to_multiply = []
while len(to_multiply) < 2 and len(arr) > 1:
    if arr[0] == arr[1]:
        to_multiply.append(arr[0])
    arr = arr[2:]
if len(to_multiply) == 2:
    print(to_multiply[0] * to_multiply[1])
else:
    print("0")


Fixed submission:
N = int(input())
freq = {}
arr = map(int,input().split())
for i in arr:
    try:
        freq[i] += 1
    except KeyError:
        freq[i] = 1

to_multiply = []      
for i in sorted(freq.keys(),reverse=True):
    if freq[i] >= 4:
        to_multiply.append(i)
        to_multiply.append(i)
    elif freq[i] >= 2:
        to_multiply.append(i)
if len(to_multiply) >= 2:
    print(to_multiply[0] * to_multiply[1])
else:
    print("0")
Buggy python submission (verdict: Runtime Error):
A = input()
B = input()

if len(A) > len(B):
    print("GREATER")
elif len(A) < len(B):
    print("LESS")
else:
    i = 0
    while A[i] == B[i]:
        i += 1
    if int(A[i]) > int(B[i]):
        print("GREATER")
    else:
        print("LESS")



Fixed submission:
A = int(input())
B = int(input())
 
if A > B:
    print("GREATER")
elif A < B:
    print("LESS")
else:
    print("EQUAL")
Buggy python submission (verdict: Runtime Error):
s = input()
K = int(input())

new = ""
for i in range(len(s) - 1):
  diff = 26 - (ord(s[i]) - 97)
  if diff <= K:
    K -= diff
    new += "a"
  else:
    new += s[i]

if K > 0:
  new_char = ord(s[-1]) + K
  if new_char > 122:
    new_char = 96 + (new_char - 122)
  new += chr(new_char)
else:
  new += s[-1]

print(new)



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

new = ""
for i in range(len(s) - 1):
  diff = (123 - ord(s[i])) % 26
  if diff <= K:
    K -= diff
    new += "a"
  else:
    new += s[i]

if K > 0:
  new_char = ord(s[-1]) + (K % 26)
  if new_char > 122:
    new_char = 96 + (new_char - 122)
  new += chr(new_char)
else:
  new += s[-1]

print(new)

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

new = ""
for i in range(len(s) - 1):
  diff = 123 - ord(s[i])
  if diff < K:
    K -= diff
    new += "a"
  else:
    new += s[i]

if K > 0:
  new_char = ord(s[-1]) + K
  if new_char > 122:
    new_char = 96 + (new_char - 122)
  new += chr(new_char)
else:
  new += s[-1]

print(new)



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

new = ""
for i in range(len(s) - 1):
  diff = (123 - ord(s[i])) % 26
  if diff <= K:
    K -= diff
    new += "a"
  else:
    new += s[i]

if K > 0:
  new_char = ord(s[-1]) + (K % 26)
  if new_char > 122:
    new_char = 96 + (new_char - 122)
  new += chr(new_char)
else:
  new += s[-1]

print(new)
Buggy python submission (verdict: Runtime Error):
x = int(input())
y = int(input())
print(int((x*3+y)/2))

Fixed submission:
x, y = [int(i) for i in input().split()]
print(int((x*3+y)/2))
Buggy python submission (verdict: Runtime Error):
X=input()
if X<30:
  print("No")
else:
  print("Yes")

Fixed submission:
X=int(input())
if X<30:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
import math
K=input()

if K%7==0:
    L=9*K/7
else:
    L=9*K

if L%2==0 or L%5==0:
    print(-1)
else:
    r=10%L
    for i in range(1,10**6+1):
        if r==1:
            ans=i
            break
        else:
            r=10*r%L

print(ans)

Fixed submission:
import math
K=int(input())

if K%7==0:
    L=9*K//7
else:
    L=9*K

if L%2==0 or L%5==0:
    ans=-1
else:
    r=10%L
    for i in range(1,10**6+1):
        if r==1:
            ans=i
            break
        else:
            r=10*r%L
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
K=input()

if K%7=0:
    L=9*K/7
else:
    L=9*K

if L%2=0 or L%5=0:
    print(-1)
else:
    r=10%L
    for i in range(1,10**6+1):
        if r==1:
            ans=i
            break
        else:
            r=10*r%L

print(ans)

Fixed submission:
import math
K=int(input())

if K%7==0:
    L=9*K//7
else:
    L=9*K

if L%2==0 or L%5==0:
    ans=-1
else:
    r=10%L
    for i in range(1,10**6+1):
        if r==1:
            ans=i
            break
        else:
            r=10*r%L
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
K=int(input())

if K%7==0:
    L=9*K//7
else:
    L=9*K

if L%2==0 or L%5==0:
    print(-1)
else:
    num=1
    while 10**num%L!=1:
        num+=1
    print(num)

Fixed submission:
import math
K=int(input())

if K%7==0:
    L=9*K//7
else:
    L=9*K

if L%2==0 or L%5==0:
    ans=-1
else:
    r=10%L
    for i in range(1,10**6+1):
        if r==1:
            ans=i
            break
        else:
            r=10*r%L
print(ans)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
r = N%K
s = K-r
print(min[r,s])

Fixed submission:
N,K = map(int,input().split())
r = N%K
s = K-r
print(min([r,s]))

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
r = N%K
s = s-r
print(min[r,s])

Fixed submission:
N,K = map(int,input().split())
r = N%K
s = K-r
print(min([r,s]))

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

while x>K/2:
    x = abs(x-K)
print(x)

Fixed submission:
N,K = map(int,input().split())
r = N%K
s = K-r
print(min([r,s]))
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
l = list(map(int,input().split()))
for i in range(len(l)):
    if not l.count(l[i])== 1:
      print("NO")
      break
    elif i == len(l)-1:
      print("YES")

Fixed submission:
N=input()
l=list(map(int,input().split()))
if len(l)!=len(set(l)):
  print("NO")
else:
  print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
N = input()
l = list(map(int,input().split()))
answer =[]
for i in range(len(l)):
    for j in range(i+1, len(l)):
        if l[i] == l[j]:
            answer.append("NO")
            break
        else:
            continue
if len(answer)==0:
  print("YES")
else:
  print("NO")

Fixed submission:
N=input()
l=list(map(int,input().split()))
if len(l)!=len(set(l)):
  print("NO")
else:
  print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
N = input()
l = list(map(int,input().split()))
answer =[]
for i in range(len(l)):
    for j in range(i+1, len(l)):
        if l[i] == l[j]:
            answer.append("NO")
        else:
            answer.append("YES")
if "NO" in answer:
  print("NO")
else:
  print("YES")

Fixed submission:
N=input()
l=list(map(int,input().split()))
if len(l)!=len(set(l)):
  print("NO")
else:
  print("YES")
Buggy python submission (verdict: Runtime Error):
N,K,M = map(int,input().split())

A = []

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

S = sum(A)
Score = M * N

n = Score - S

if n >=0 and n <= 100:
    print(n)
elif n > 100:
    print('-1')
else:
    print(0)


Fixed submission:
x = input()
l = [chr(i) for i in range(97, 97+26)]

for i in range(26):
    if l[i]== x:
        k = i
        
print(l[k+1])

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

A = []

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

S = sum(A)
Score = M * N

n = Score - S

if n >=0 and n < 100:
    print(n)
elif n >= 100:
    print('-1')
else:
    print(0)

Fixed submission:
x = input()
l = [chr(i) for i in range(97, 97+26)]

for i in range(26):
    if l[i]== x:
        k = i
        
print(l[k+1])
Buggy python submission (verdict: Runtime Error):
A,P=map(int,input().split())
B=(3A+P)//2
print(B)

Fixed submission:
A,P=map(int,input().split())
B=(3*A+P)//2
print(B)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
S=input()
T=list(S)
T[K-1]=T[K-1].lower()
S_changed="".join(T)
print(S_changed

Fixed submission:
N,K=map(int,input().split())
S=input()
T=list(S)
T[K-1]=T[K-1].lower()
S_changed="".join(T)
print(S_changed)
Buggy python submission (verdict: Runtime Error):
str=input()
x=len(str)
if x=2:
  print(str)
else:
  print(str[::-1])

Fixed submission:
str=input()
x=len(str)
if x==2:
   print(str)
else:
   print(str[::-1])
Buggy python submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
list=［A,B,C］
M=max(list)
D=9＊M+A+B+C
print(D)

Fixed submission:
A,B,C=map(int,input().split())
list=[A,B,C]
M=max(list)
N=A+B+C
D=9*M+N
print(D)
Buggy python submission (verdict: Runtime Error):
def f(n, a):
  if 0 in a:
    return 0
  p = 1
  for x in a:
    p *= x
    if p > 10**18:
      return -1
  return p

n = int(input())
a = list(int, input().split())
print(f(n, a))

Fixed submission:
def f(n, a):
  if 0 in a:
    return 0
  p = 1
  for x in a:
    p *= x
    if p > 10**18:
      return -1
  return p
 
n = int(input())
a = list(map(int, input().split()))
print(f(n, a))
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
ai = int(a)
bf = froat(b)
print(int(ai*bf))

Fixed submission:
a, b = map(int, input().replace(".", "").split())
print(a*b//100)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
sunuke = [1 for _ in range(n)]
for _ in range(k):
  d = int(input())
  for x in list(map(int, input().split()):
    sunuke[x-1] = 0
print(sum(sunuke))

Fixed submission:
n, k = map(int, input().split())
sunuke = [1 for _ in range(n)]
for _ in range(k):
  d = int(input())
  for x in list(map(int, input().split())):
    sunuke[x-1] = 0
print(sum(sunuke))
Buggy python submission (verdict: Runtime Error):

if 4*a*b < (c-a-b) ** 2 and c-a-b > 0:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c = map(int, input().rstrip().split())
if 4*a*b < (c-a-b) ** 2 and c-a-b > 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
h,a = tuple(map(int,input().rstrip().sprit()))
print((h+a-1)//a)


Fixed submission:
h,a = tuple(map(int,input().rstrip().split()))
print((h+a-1)//a)

Buggy python submission (verdict: Runtime Error):
h,a = tuple(map(int,input().rstrip().sprit()))
print((h+a-1)//a)

Fixed submission:
h,a = tuple(map(int,input().rstrip().split()))
print((h+a-1)//a)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
def dp(H, N, a, b):
  d = defaultdict(lambda: INF)
  d[0] = 0
  max_a = max(a)
  for h in range(1, H + max_a):
    d[h] = min([d[h - a[i]] + b[i] for i in range(N)])
  return min([d[H + h] for h in range(max_a)])

INF = 10 ** 10
H, N = map(int, input().split())
a = [0 for _ in range(N)]
b = [0 for _ in range(N)]
for i in range(N):
  ai, bi = map(int, input().split())
  a[i] = ai
  b[i] = bi
print(dp(H, N, a, b))

Fixed submission:
def dp(H, N, ab):
  max_a = max([ab[i][0] for i in range(N)])
  d = [INF for _ in range(H + max_a)]
  d[0] = 0
  for h in range(1, H + max_a):
    d[h] = min(d[h - a] + b for a, b in ab)
  return min(d[H:])
INF = 10 ** 10
H, N = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(N)]
print(dp(H, N, ab))

Buggy python submission (verdict: Time Limit Exceeded):
h, n = map(int, input().rstrip().split())
a = []
b = []
for _ in range(n):
  ai, bi = map(int, input().rstrip().split())
  a.append(ai)
  b.append(bi)

inf = 10 ** 10
minmp = [inf for _ in range(h+1)]
minmp[0] = 0
for i in range(n):
  for j in range(h+1):
    minmp[j] = min([minmp[k] + (j-k+a[i]-1)//a[i] * b[i] for k in range(j+1)])
print(minmp[-1])

Fixed submission:
def dp(H, N, ab):
  max_a = max([ab[i][0] for i in range(N)])
  d = [INF for _ in range(H + max_a)]
  d[0] = 0
  for h in range(1, H + max_a):
    d[h] = min(d[h - a] + b for a, b in ab)
  return min(d[H:])
INF = 10 ** 10
H, N = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(N)]
print(dp(H, N, ab))

Buggy python submission (verdict: Runtime Error):
def mincost(h, m, i):
  if i == len(m) - 1:
    return (1 + (h - 1) // m[i][0]) * m[i][1]
  return min((1 + (h - 1) // m[i][0]) * m[i][1],
            mincost(h % m[i][0], m, i+1))

h, n = list(map(int, input().rstrip().split()))
m = [tuple(map(int, input().rstrip().split())) for _ in range(n)]

m.sort(key = lambda x: x[0])
m.sort(key = lambda x: x[0] / x[1], reversed = True)

print(mincost(h, m, 0))

Fixed submission:
def dp(H, N, ab):
  max_a = max([ab[i][0] for i in range(N)])
  d = [INF for _ in range(H + max_a)]
  d[0] = 0
  for h in range(1, H + max_a):
    d[h] = min(d[h - a] + b for a, b in ab)
  return min(d[H:])
INF = 10 ** 10
H, N = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(N)]
print(dp(H, N, ab))
Buggy python submission (verdict: Runtime Error):
option = [1, 2, 3]
option.pop(int(input()) - 1)
option.pop(int(input()) - 1)
for x in option:
  print(x)

Fixed submission:
wrong = [int(input()) for _ in range(2)]
for x in range(1, 4):
    if x not in wrong:
        print(x)
Buggy python submission (verdict: Runtime Error):
import math
a, b = tuple(map(int,input().rstrip().split()))
print(a * b // math.gcd(a, b))

Fixed submission:
def gcd(a, b):
    r = a % b
    if r == 0:
        return b
    else:
	    return gcd(b, r)
def lcm(a,b):
    return a * b // gcd(a, b)
a,b = tuple(map(int,input().rstrip().split()))
print(lcm(a, b))
Buggy python submission (verdict: Runtime Error):
arphs = list(ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ)
n = int(input())
s = list(input())
i = []
for x in s:
  i.append(arphs.index(x) + n)
print("".join(i))

Fixed submission:
arphs = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
n = int(input())
s = list(input())
i = []
for x in s:
  i.append(arphs[arphs.index(x) + n])
print("".join(i))
Buggy python submission (verdict: Runtime Error):
import math
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, m = [int(i) for i in input().split(" ")]

print(comb(n,2) + comb(m,2))

Fixed submission:
import math
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, m = [int(i) for i in input().split(" ")]
r = 0
if n > 1:
  r += comb(n, 2)
if m > 1:
  r += comb(m, 2)
print(r)
Buggy python submission (verdict: Runtime Error):
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(arr[k+1])

Fixed submission:
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(arr[k-1])
Buggy python submission (verdict: Runtime Error):
a = input()
s = int(input())
print(s if a >= 3200 else 'red')

Fixed submission:
a = int(input())
s = input()
print(s if a >= 3200 else 'red')
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
s = []
for i in range(n):
  	s.append(input())
    
counts = [Counter(i) for i in s]
result = 0
for i in range(len(counts)):
  for j in range(i+1, len(counts), 1):
    if counts[i] == counts[j]:
      result += 1
print(result)

Fixed submission:
from collections import Counter
n = int(input())
s = []
for i in range(n):
  	s.append(input())

s = ["".join(sorted(i)) for i in s]
table = {}

count = 0
for word in s:
  if word in table:
    count += table[word]
    table[word] += 1
  else :
    table[word] = 1
print(count)
Buggy python submission (verdict: Runtime Error):
s = input()
atcg = ["A", "T", "C", "G"]
index = []
for i in range(len(s)-1):
  if s[i] not in atcg:
    index.append(i)

max = index[0]
for i in range(1, len(index), 1):
  if index[i] - index[i-1] - 1> max:
    max = index[i] - index[i-1] - 1 
print(max)

Fixed submission:
def change(c):
  if c in atcg:
    return "1"
  else:
    return "0"
  
s = input()
atcg = "ATCG"
s = "".join([change(i) for i in s])
print(max([len(i) for i in s.split("0")]))

Buggy python submission (verdict: Runtime Error):
s = input()
atcg = ["A", "T", "C", "G"]

max = 0
for i in range(len(s)-1):
  j = i
  while s[j] in atcg:
    if max <= j - i + 1:
      max = j - i + 1
    j += 1
      
print(max)

Fixed submission:
def change(c):
  if c in atcg:
    return "1"
  else:
    return "0"
  
s = input()
atcg = "ATCG"
s = "".join([change(i) for i in s])
print(max([len(i) for i in s.split("0")]))
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split(" "))

l = [1]
for i in range(2, min(a, b), 1):
  if a % i == 0 and b % i == 0:
    l.append(i)

print(l[k-1])

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

l = [1]
for i in range(2, min(a, b) + 1, 1):
  if a % i == 0 and b % i == 0:
    l.append(i)

print(l[-k])
Buggy python submission (verdict: Runtime Error):
def culc(i, dp, h, n):
  if i == n - 1 :
    return dp[n - 1]
  
  cost1 = abs(h[i - 1] - h[i + 1])
  cost2 = abs(h[i] - h[i + 1])
  
  dp.append(dp[i - 1] + cost1 if cost1 <= cost2 else dp[i] + cost2)
  return culc(i + 1, dp, h, n)
    

n = int(input())
h = [int(i) for i in input().split(" ")]

dp = [0, abs(h[0] - h[1])]
print(culc(1, dp, h, n))


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

dp = [0] * n
dp[1] = abs(h[1] - h[0])

for i in range(2, n, 1):
  cost1 = abs(h[i-2] - h[i])
  cost2 = abs(h[i-1] - h[i])
  dp[i] = min(dp[i-2] + cost1, dp[i-1] + cost2)

print(dp[n-1])

Buggy python submission (verdict: Runtime Error):
def culc(i, dp, h, n):
  if i == n - 1 :
    return dp[n - 1]
  
  cost1 = abs(h[i - 1] - h[i + 1])
  cost2 = abs(h[i] - h[i + 1])
  
  dp.append(dp[i - 1] + cost1 if cost1 <= cost2 else dp[i] + cost2)
  return culc(i + 1, dp, h, n)
    

n = int(input())
h = [int(i) for i in input().split(" ")]

dp = [0, abs(h[0] - h[1])]
print(culc(1, dp, h, n))


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

dp = [0] * n
dp[1] = abs(h[1] - h[0])

for i in range(2, n, 1):
  cost1 = abs(h[i-2] - h[i])
  cost2 = abs(h[i-1] - h[i])
  dp[i] = min(dp[i-2] + cost1, dp[i-1] + cost2)

print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split(" "))
h = [int(i) for i in input().split(" ")]

dp = [0] * n

for i in range(1, n, 1):
  candidate = []
  for j in range(min(i, k)) :
    candidate.append(dp[i - j - 1] + abs(h[i - j -1] - h[i]))
  dp[i] = min(candidate)

print(dp[n-1])

Fixed submission:
n, k = map(int, input().split(" "))
h = [int(i) for i in input().split(" ")]

dp = [0] * n

for i in range(1, n, 1):
  candidate = []
  for j in range(min(i, k)) :
    candidate.append(dp[i - j - 1] + abs(h[i - j -1] - h[i]))
  dp[i] = min(candidate)

print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))



f=[True]*(max(A)+1)
chk=[0]*(max(A)+1)

for a in A:
    chk[a]+=1

for a in A:
    cnt=2
    while a*cnt<=max(A):
        f[a*cnt]=False
        cnt+=1
ans=0
for a in A:
    if f[a]==True and chk[a]==1:
        ans+=1
print(ans)


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

mx=max(A)
f=[True]*(mx+1)
chk=[0]*(mx+1)

for a in A:
    chk[a]+=1

for a in A:
    cnt=2
    while a*cnt<=mx:
        f[a*cnt]=False
        cnt+=1
ans=0
for a in A:
    if f[a]==True and chk[a]<=1:
        ans+=1
print(ans)

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

A=list(set(A))

L=len(A)

if L==1:
    print(0)
    exit()

mx=max(A)

f=[1]*L

A.sort()

for i in range(N):
    if A[i]*2>mx:break
    for j in range(i+1,N):
        if A[j]%A[i]==0:
            f[j]=0

print(sum(f))


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

mx=max(A)
f=[True]*(mx+1)
chk=[0]*(mx+1)

for a in A:
    chk[a]+=1

for a in A:
    cnt=2
    while a*cnt<=mx:
        f[a*cnt]=False
        cnt+=1
ans=0
for a in A:
    if f[a]==True and chk[a]<=1:
        ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

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

NA=[]

for i in range(N):
    NA.append(A[i]-i)

cnt=0
for i in range(N-1):
    cnt+=NA.count(-i-A[i])

print(cnt)



Fixed submission:
N=int(input())

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

NA=[]

for i in range(N):
    NA.append(A[i]-i)

from collections import Counter

d=Counter(NA)

cnt=0
for i in range(N-1):
    cnt+=d[-i-A[i]]

print(cnt)
Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())

RO=list(map(int,input().split()))
GO=list(map(int,input().split()))
TO=list(map(int,input().split()))

RO.sort()
GO.sort()
TO.sort(reverse=True)

R=RO[A-X:A]
G=GO[B-Y:B]
ans=sum(R)+sum(G)

idxR=0
idxG=0
for i in range(C):
    t=TO[i]
    if idxR<A and idxG<B:
        mi=min(R[idxR],G[idxG],t)
        if mi==t:break
        elif mi==R[idxR]:
            ans=ans-R[idxR]+t
            idxR+=1
        elif mi==G[idxG]:
            ans=ans-G[idxG]+t
            idxG+=1
    elif idxR>=A and idxG<B:
        mi=min(G[idxG],t)
        if mi==t:break
        else:
            ans=ans-G[idxG]+t
            idxG+=1
    elif idxR<A and idxG>=B:
        mi=min(R[idxR],t)
        if mi==t:break
        else:
            ans=ans-R[idxR]+t
            idxR+=1
    elif idxR>=A and idxG>=B:break
print(ans)



Fixed submission:
X,Y,A,B,C=map(int,input().split())

RO=list(map(int,input().split()))
GO=list(map(int,input().split()))
TO=list(map(int,input().split()))

RO.sort()
GO.sort()

R=RO[A-X:A]
G=GO[B-Y:B]

TO.extend(R)
TO.extend(G)

TO.sort(reverse=True)

T=TO[0:X+Y]

print(sum(T))

Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())

RO=list(map(int,input().split()))
GO=list(map(int,input().split()))
TO=list(map(int,input().split()))

RO.sort()
GO.sort()
TO.sort(reverse=True)

R=RO[A-X:A]
G=GO[B-Y:B]
ans=sum(R)+sum(G)

idxR=0
idxG=0
for t in TO:
    if idxR<A and idxG<B:
        mi=min(R[idxR],G[idxG],t)
        if mi==t:break
        elif mi==R[idxR]:
            ans=ans-R[idxR]+t
            idxR+=1
        elif mi==G[idxG]:
            ans=ans-G[idxG]+t
            idxG+=1
    elif idxR>=A and idxG<B:
        mi=min(G[idxG],t)
        if mi==t:break
        else:
            ans=ans-G[idxG]+t
            idxG+=1
    elif idxR<A and idxG>=B:
        mi=min(R[idxR],t)
        if mi==t:break
        else:
            ans=ans-R[idxR]+t
            idxR+=1
    elif idxR>=A and idxG>=B:break
print(ans)



Fixed submission:
X,Y,A,B,C=map(int,input().split())

RO=list(map(int,input().split()))
GO=list(map(int,input().split()))
TO=list(map(int,input().split()))

RO.sort()
GO.sort()

R=RO[A-X:A]
G=GO[B-Y:B]

TO.extend(R)
TO.extend(G)

TO.sort(reverse=True)

T=TO[0:X+Y]

print(sum(T))