Harryxun/stf_run huggingface dataset:
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 
     131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 
     67108864, 134217728, 268435456, 536870912]

t = []
bIdx = 0
for aa in a :
    while b[bIdx] <= aa:
        bIdx += 1   
    t.append(b[bIdx]-aa)
t.reverse()
a.sort(reverse=True)

c = {}
for aa in a:
    if aa in c:
        c[aa] += 1
    else:
        c[aa] = 1

sum = 0
i = 0

u = [0 for i in range(len(a))]

for i in range(len(a)-1):

    if u[i] > 0:
        continue

    if t[i] in c :
        if c[t[i]] > 0 :
            sum += 1
            c[t[i]] -= 1
        
print(sum)

### FIXED CODE ###

from bisect  import bisect_left

n = int(input())
a = list(map(int,input().split()))
a.sort()
#print(a)

sum = 0
for i in range (len(a)-1,-1,-1):

    b = 1
    while b <= a[i]:
        b = b<<1
    t = b - a[i]
    #print("2^",t)

    k = bisect_left(a,t)
    if a[k] == t and k < i:
        sum += 1
        a[k] -= 0.1
        a[i] += 0.1
print(sum)
def solve():
  N,M = map(int, input().split())
  A = list(map(int, input().split()))
  A.sort()
  ret = sum(A)
  CB = {}
  C_heap = []
  for _ in range(M):
    b,c  = map(int, input().split())
    if c in CB:
      CB[c] += b
    else:
      CB[c] = b
      heapq.heappush(C_heap, -c)

  c = (-1)*heapq.heappop(C_heap)
  for a in A:
    if CB[c] == 0:
      if not C_heap: break

      c = (-1)*heapq.heappop(C_heap)
    
    if c <= a:
      break

    ret += c-a
    CB[c] -= 1

  print(ret)
  
solve()

### FIXED CODE ###

import heapq

def solve():
  N,M = map(int, input().split())
  A = list(map(int, input().split()))
  A.sort()
  ret = sum(A)
  CB = {}
  C_heap = []
  for _ in range(M):
    b,c  = map(int, input().split())
    if c in CB:
      CB[c] += b
    else:
      CB[c] = b
      heapq.heappush(C_heap, -c)

  c = (-1)*heapq.heappop(C_heap)
  for a in A:
    if CB[c] == 0:
      if not C_heap: break

      c = (-1)*heapq.heappop(C_heap)
    
    if c <= a:
      break

    ret += c-a
    CB[c] -= 1

  print(ret)
  
solve()
l = raw_input().split()
N = int(l[0])
M = int(l[1])

L = []
R = []

for i in range(M):
    l = raw_input().split()
    L.append(int(l[0]))
    R.append(int(l[1]))

l = max(L)
#r = min(R)
print(l, r)
if l > r:
    print(0)
else:
    print(r - l + 1)


### FIXED CODE ###

l = raw_input().split()
N = int(l[0])
M = int(l[1])

L = []
R = []

for i in range(M):
    l = raw_input().split()
    L.append(int(l[0]))
    R.append(int(l[1]))

l = max(L)
r = min(R)
# print(l, r)
if l > r:
    print(0)
else:
    print(r - l + 1)
N=int(input())
H=list(map(int,input().split()))

def cost(k):
    if k==0:
        return 0
    elif k==1:
        return abs(H[1]-H[0])
    else:
        return min(cost(k-1)+abs(H[k]-H[k-1]),cost(k-2)+abs(H[k]-H[k-2]))

print(cost(N-1))



### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

N=int(input())
H=list(map(int,input().split()))

cost_list=[0 for _ in range(N)]

cost_list[1]=abs(H[1]-H[0])

if N==2:
    print(cost_list[1])

else:
    for k in range(2,N):
        cost_list[k]=min(cost_list[k-1]+abs(H[k]-H[k-1]),cost_list[k-2]+abs(H[k]-H[k-2]))

    print(cost_list[N-1])
n = int(input())
list = [0] * 1000001

for i in range(n):
  num = int(input())
  if list[num - 1] == 0:
    list[num - 1] = 1
  else:
    list[num - 1] = 0

print(sum(list))

### FIXED CODE ###

n = int(input())
A = [0] * n
for i in range(n):
  A[i] = int(input())
from collections import Counter
C = Counter(A)
counter = 0
for val in C.values():
  counter += val % 2
print(counter)
import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, M = map(int, input().split())
    memo = [0] * (N + 1)
    a = [0] * M

    memo[0] = 0
    memo[1] = 1
    memo[2] = 2
    for i in range(3, N+1):
        memo[i] = memo[i-1] + memo[i-2]

    # print(memo)
    ans = 1

    for i in range(M):
        a[i] = int(input())

        if i != 0 and abs(a[i] - a[i-1]) == 1:
            print(0)
            return

        if a[i] == 1:
            ans *= 1
        elif i == 0:
            ans *= memo[a[i] - 1]
            ans %= MOD
            # print(a[i], ans, a[i] - 1)
        else:
            ans *= memo[a[i] - a[i-1] - 2]
            ans %= MOD
            # print(a[i], ans, a[i] - a[i-1] - 2)

    ans *= memo[N - a[M-1] - 1]
    ans %= MOD
    # print(ans, N - a[M-1] - 1)
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, M = map(int, input().split())
    memo = [0] * max((N + 1), 10)
    a = [0] * M

    memo[0] = 1
    memo[1] = 1
    memo[2] = 2
    for i in range(3, max(N+1, 10)):
        memo[i] = memo[i-1] + memo[i-2]

    # print(memo)
    ans = 1

    for i in range(M):
        a[i] = int(input())

        if i != 0 and abs(a[i] - a[i-1]) == 1:
            print(0)
            return

        if a[i] == 1:
            ans *= 1
        elif i == 0:
            ans *= memo[a[i] - 1]
            ans %= MOD
            # print(a[i], ans, a[i] - 1)
        else:
            ans *= memo[a[i] - a[i-1] - 2]
            ans %= MOD
            # print(a[i], ans, a[i] - a[i-1] - 2)

    if M == 0:
        ans *= memo[N]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)
    else:
        ans *= memo[N - a[M-1] - 1]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)


if __name__ == '__main__':
    main()
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math

l = map(int, raw_input().split())
A = map(int, raw_input().split())

if l[2] in A:
    M = l[1] - A.index(l[2])
    if M > A.index(l[2]):
        print A.index(l[2])
    else:
        print M
sm = l[2]
la = l[2]
while(TRUE):
    sm = sm - 1
    la = la + 1
    if sm in A and la in A:
    	ix = A.index(sm) + A.index(la)
	ix = ix / 2
	break
    if sm in A:
    	ix = A.index(sm)
	break
    if la in A:
	ix = A.index(la)
	break
M = l[1] - ix
if M > ix:
    print math.floor(ix)
else:
    print M


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math

l = map(int, raw_input().split())
A = map(int, raw_input().split())

sm = l[2]
la = l[2]
while(True):
    if sm == 0:
        print 0
    if la == l[0]:
        print 0
    sm = sm - 1
    la = la + 1
    if sm in A and la in A:
    	ix = A.index(sm) + A.index(la)
        ix = ix / 2 + 0.5
        break
    if sm in A:
        ix = A.index(sm) + 0.5
	break
    if la in A:
	ix = A.index(la) - 0.5
	break
M = l[1] - ix - 1
if M > ix:
    print int(math.ceil(ix))
else:
    print int(math.ceil(M))
S=str(input())
size=len(S)

print(S[0]+int(int(size)-2)+S[-1])

### FIXED CODE ###

S=str(input())
size=len(S)

print(S[0]+str(int(size)-2)+S[-1])
print(input().count"1")

### FIXED CODE ###

print(input().count("1"))
import numpy as np
from numba import njit
 
@njit
def count(l,n):
  ct = 0
  for i in range(n):
    for j in range(i + 1, n):
      for k in range(j + 1, n):
        ct += (l[k] < l[i] + l[j])
  return ct

         
n = int(input())
l = np.int32(input().split())
l.sort()

ans = count(l,n)

print(ans)

### FIXED CODE ###

import bisect
n = int(input())
l = sorted([int(i) for i in input().split()])

ans = 0
for i in range(n):
    for j in range(i+1,n):
        a = l[i]
        b = l[j]
        tri = bisect.bisect_left(l,a+b)
        ans += tri-j-1
        
print(ans)
N , L = map(int, input().split())

list = [L + (i+1)-1 for i in range(N)]

list.sort(key=lambda x:abs(x))

del list[0]
print(list)

### FIXED CODE ###

strings = list(input())
before_number = 100000
flag = False
for number in strings:
  #前の番号と今の番号が一致したら
  if before_number == int(number):
    flag = True
  else:
    before_number = int(number)

if flag == True:
  print("Bad")
else:
  print("Good")
n, m = list(map(int, input().split()))
maze = []
for i in range(n):
  l = input()
  dl = []
  for j in range(m):
    if l[j] == '.':
      dl.append(0)
    else:
      dl.append(1)
  maze.append(dl)
ans = 0
for i in range(n):
  for j in range(m):
    if maze[i][j] == 0:
      a = [list(l) for l in maze]
      a[i][j] = 1
      q = [(i, j)]
      d = 0
      while len(q) > 0:
        nq = []
        d += 1
        for x, y in q:
          if x > 0 and a[x - 1][y] == 0:
            a[x - 1][y] = 1
            np.append((x - 1, y))
          if y > 0 and a[x][y - 1] == 0:
            a[x][y - 1] = 1
            np.append((x, y - 1))
          if x < n - 1 and a[x + 1][y] == 0:
            a[x + 1][y] = 1
            np.append((x + 1, y))
          if y < m - 1 and a[x][y + 1] == 0:
            a[x][y + 1] = 1
            np.append((x, y + 1))
        q = nq
      ans = max(ans, d)
print(ans)

### FIXED CODE ###

n, m = list(map(int, input().split()))
maze = []
for i in range(n):
  l = input()
  dl = []
  for j in range(m):
    if l[j] == '.':
      dl.append(0)
    else:
      dl.append(1)
  maze.append(dl)
ans = 0
for i in range(n):
  for j in range(m):
    if maze[i][j] == 0:
      a = [list(l) for l in maze]
      a[i][j] = 1
      q = [(i, j)]
      d = 0
      while len(q) > 0:
        nq = []
        for x, y in q:
          if x > 0 and a[x - 1][y] == 0:
            a[x - 1][y] = 1
            nq.append((x - 1, y))
          if y > 0 and a[x][y - 1] == 0:
            a[x][y - 1] = 1
            nq.append((x, y - 1))
          if x < n - 1 and a[x + 1][y] == 0:
            a[x + 1][y] = 1
            nq.append((x + 1, y))
          if y < m - 1 and a[x][y + 1] == 0:
            a[x][y + 1] = 1
            nq.append((x, y + 1))
        if len(nq) > 0:
          d += 1
        q = nq
      ans = max(ans, d)
print(ans)
n = [int(c) for c in input()]
for i in range(2 ** 3):
    os = format(i, "03b").replace("1", "+").replace("0", "-")
    temp = n[0]
    for i, c in enumerate(os):
        num = n[i + 1]
        temp += num if c == "+" else -num
    if temp == 7:
        ans = "{0}{4}{1}{5}{2}{6}{3}=7".format(*n, *os)
        break
print(ans)

### FIXED CODE ###

n = [int(c) for c in input()]
template_list = [
    "{}+{}+{}+{}",
    "{}+{}+{}-{}",
    "{}+{}-{}+{}",
    "{}+{}-{}-{}",
    "{}-{}+{}+{}",
    "{}-{}+{}-{}",
    "{}-{}-{}+{}",
    "{}-{}-{}-{}",
]
for template in template_list:
    temp = template.format(*n)
    if eval(temp) == 7:
        ans = "{}=7".format(temp)
        break
print(ans)
k = int(input())

import fractions

flag = False

for i in range(n):
    f = fractions.gcd(k,(10**n-1)/9*7)
    if f == k:
        flag = True
        break

if flag:
    print(i+1)
else:
    print(-1)

### FIXED CODE ###

k = int(input())

flag = False

resid  = 7
if resid%k==0:
    i = -1
    flag = True
else:
    for i in range(k):
        resid = (resid*10+7)%k
        if resid == 0:
            flag = True
            break

if flag:
    print(i+2)
else:
    print(-1)
dishes = []
for i in range(5):
    dishes.append(input())
    
idx = 0
min_ones_place = 9

for j in range(5):
    ones_place = int(dishes[j][-1])
    if ones_place != 0:
        if ones_place < min_ones_place:
            min_ones_place = ones_place
            idx = j
            
last_dish = int(dishes.pop(idx))

total_time = 0
for k in range(4):
    total_time += int(dishes[k])
    if total_time % 10 == 0:
        pass
    else :
        total_time = int(Decimal(str(total_time)).quantize(Decimal('1E1'), rounding=ROUND_UP))

total_time += last_dish
print(total_time)

### FIXED CODE ###

from decimal import *

dishes = []
for i in range(5):
    dishes.append(input())
    
idx = 0
min_ones_place = 9

for j in range(5):
    ones_place = int(dishes[j][-1])
    if ones_place != 0:
        if ones_place < min_ones_place:
            min_ones_place = ones_place
            idx = j
            
last_dish = int(dishes.pop(idx))

total_time = 0
for k in range(4):
    total_time += int(dishes[k])
    if total_time % 10 == 0:
        pass
    else :
        total_time = int(Decimal(str(total_time)).quantize(Decimal('1E1'), rounding=ROUND_UP))

total_time += last_dish
print(total_time)
inputs = list(map(str, input()))

output = ''
for i in inputs:
	if output == 'B':
    	output = output[:-1]
	elif output == '1':
		output += '1'
    else:
      	output += '0'
print(output)

### FIXED CODE ###

inputs = list(map(str, input()))
 
output = ''
for i in inputs:
    if i == 'B':
        output = output[:-1]
    elif i == '1':
        output += '1'
    else:
          output += '0'
print(output)
n=int(input())
ga,sa,ba=map(int,input().split())
gb,sb,bb=map(int,input().split())
def f(a,b,c,d,e,f,n):
    s=[[a,d-a],[b,e-b],[c,f-c]]
    s=[i for i in s if i[1]>0]
    dp=[0]*(n+1)
    if len(s)==0:
        return n
    if len(s)==1:
        return d*n//a+n%a
    else:
        for p,q in s:
            for j in range(a,n+1):
                dp[j]=max(dp[j],dp[j-p]+q)
        return dp[n]
print(f(gb,sb,bb,ga,sa,ba,f(ga,sa,ba,gb,sb,bb,n)))

### FIXED CODE ###

n=int(input())
a,b,c=map(int,input().split())
d,e,f=list(map(int,input().split()))
s=[0]*(n+1)
for i in range(a,n+1):
    s[i]=max(s[i],s[i-a]+d-a)
for i in range(b,n+1):
    s[i]=max(s[i],s[i-b]+e-b)
for i in range(c,n+1):
    s[i]=max(s[i],s[i-c]+f-c)
n+=s[-1]
s=[0]*(n+1)
for i in range(d,n+1):
    s[i]=max(s[i],s[i-d]+a-d)
for i in range(e,n+1):
    s[i]=max(s[i],s[i-e]+b-e)
for i in range(f,n+1):
    s[i]=max(s[i],s[i-f]+c-f)
print(s[-1]+n)
n = int(input())
a = list(map(int,input().split()))
a2 = list(map(lambda x:x*2,a))
All = sum(a)
t = 0
while True :
    t += 1
    if t > n :
        exit()
    print(All-a2[1::2])
    a2.append(a2[0])
    del a2[0]

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a2 = list(map(lambda x:x*2,a))
All = sum(a)
p = All-sum(a2[1::2])
a3 = [p]
for i in range(n-1) :
    p = a[i]*2 - p
    a3.append(p)
mountain = ""
for j in range(n) :
    mountain += str(a3[j])
    if j == n-1 :
        print(mountain)
        exit()
    mountain += " "
import math
from copy import copy
di = {}
di[0] = 0
for i in range(1, 2*(10**6):
    di[i] = 0
for i in range(1, 2*(10**6)):
    count = 0
    for j in range(int(math.log2(i))+2):
        if (i>>j)&1:
            count += 1
    di[i] = di[i%count] + 1
n = int(input())
x = list(input())
x.reverse()
count = 0
for i in x:
    if i =='1':
        count += 1
mod_p = count + 1
mod_m = count - 1
di_p = {}
di_m = {}
for i in range(n):
    di_p[i] = pow(2, i, mod_p)
    di_m[i] = pow(2, i, mod_m)
s_p = 0
s_m = 0
for i in range(n):
    if x[i] == '1':
        s_p += di_p[i]
        s_m += di_m[i]
for i in range(n):
    sm = copy(s_m)
    sp = copy(s_p)
    if x[i] == '1':
        sm -= di_m[i]
        sm %= mod_m 
        print(di[sm]+1)
    else:
        sp += di_p[i]
        sp %= mod_p
        print(di[sp]+1)

### FIXED CODE ###

import math
from copy import copy
di = {}
di[0] = 0
for i in range(1, 2*(10**6)+1):
    di[i] = 0
for i in range(1, 2*(10**6)+1):
    count = 0
    for j in range(int(math.log2(i))+4):
        if (i>>j)&1:
            count += 1
    di[i] = di[i%count] + 1
n = int(input())
x = list(input())
x.reverse()
count = 0
for i in x:
    if i =='1':
        count += 1
mod_p = count + 1
mod_m = count - 1
di_p = {}
di_m = {}
for i in range(n):
    di_p[i] = pow(2, i, mod_p)
    if mod_m >= 1:
        di_m[i] = pow(2, i, mod_m)
s_p = 0
s_m = 0
for i in range(n):
    if x[i] == '1':
        s_p += di_p[i]
        if mod_m >= 1:
            s_m += di_m[i]
    else:
        continue
for i in range(n-1, -1, -1):
    sm = copy(s_m)
    sp = copy(s_p)
    if x[i] == '1' and (mod_m == 0 or mod_m == -1):
        print(0)
    elif x[i] == '1':
        sm -= di_m[i]
        sm %= mod_m 
        print(di[sm]+1)
    else:
        sp += di_p[i]
        sp %= mod_p
        print(di[sp]+1)
S, T = input().split()
A, B = map(int,iunput().split())
U = input()

if U == S:
  A -= 1
else:
  B -= 1

print(A, B)

### FIXED CODE ###

S, T = input().split()
A, B = map(int,input().split())
U = input()

if U == S:
  A -= 1
else:
  B -= 1

print(A, B)
n=int(input())
m==1
for i in range(2,100000):
    if i**2<=n:
        m=max(i,m)
print(m)
    


### FIXED CODE ###

n=int(input())
a=[]
for i in range(1,100000):
    if i**2<=n:
        a.append(i)
print((max(set(a)))**2)
import math
a, b, c = map(int, input().split())

A = math.sqrt(a)
B = math.sqrt(b)
C = math.sqrt(c)

if math.isclose(A + B, C):
    A = float(math.sqrt(a), "1000000f")
    B = float(math.sqrt(b), "1000000f")
    C = float(math.sqrt(c), "1000000f")
    if A + B < C:
        print("Yes")
    else:
        print("No")
else:
    if A + B < C:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

a,b,c = I()
if c < a+b:
    print("No")
    sys.exit()

if 2*a*b < c**2 + a**2 + b**2 - 2*c*a-2*b*c:
    print("Yes")
else:
    print("No")
a, b = map(int, input().split())

print(max[a - 2 * b, 0])

### FIXED CODE ###

a, b = map(int, input().split())
n = max([a - 2 * b, 0])
print(n)
S = input()
s1 = int(S[:2])
s2 = int(S[2:])

if 1 <= s1 <= 12 and 1 <= s2 <= 12:
  print('AMBIGUOUS')
elif 1 <= s1 <= 12 and (s2 == 0 or s2 >= 13):
  print('MMYY')
elif (s1 == 0 or s1 >= 13) and 1 <= s2 <= 12:
  print('YMMM')
elif (s1 == 0 or s1 >= 13) and (s2 == 0 or s2 >= 13)
  print('NA')

### FIXED CODE ###

S = input()
s1 = int(S[:2])
s2 = int(S[2:])

def may_month(s):
  return 1<=s<=12

# どっちもMMかもしれない
if may_month(s1) and may_month(s2):
  print("AMBIGUOUS")
  
# どっちもMMじゃない
elif not (may_month(s1) or may_month(s2)):
  print("NA")

# 前半がMMかもしれない
elif may_month(s1):
  print("MMYY")
  
# 後半がMMかもしれない
elif may_month(s2):
  print("YYMM")
from sys import stdin

def solve(N, xys):
    diff = []
    diff_count = []
    idx = 0
    for i in range(N-1):
        for j in range(i+1,N):
            tmp_a = [xys[i][0] - xys[j][0], xys[i][1] - xys[j][1]]
            tmp_b = [xys[j][0] - xys[i][0], xys[j][1] - xys[i][1]]
            if tmp_a in diff or tmp_b in diff:
                diff_count[diff.index(tmp_a)] += 1
            else:
                diff.append(tmp_a)
                diff_count.append(1)
                idx += 1
    return N - max(diff_count)

if __name__ == '__main__':
    N = int(stdin.readline().rstrip())
    xys = []
    for i in range(N):
        xys.append([int(x) for x in stdin.readline().rstrip().split()])
    print(solve(N, xys))


### FIXED CODE ###

from sys import stdin

def solve(N, xys):
    diff = []
    diff_count = []
    idx = 0
    for i in range(N-1):
        for j in range(i+1,N):
            tmp_a = [xys[i][0] - xys[j][0], xys[i][1] - xys[j][1]]
            tmp_b = [xys[j][0] - xys[i][0], xys[j][1] - xys[i][1]]
            if tmp_a in diff:
                diff_count[diff.index(tmp_a)] += 1
            elif tmp_b in diff:
                diff_count[diff.index(tmp_b)] += 1
            else:
                diff.append(tmp_a)
                diff_count.append(1)
                idx += 1
    if diff == []:
        diff_count.append(0)
    return N - max(diff_count)

if __name__ == '__main__':
    N = int(stdin.readline().rstrip())
    xys = []
    for i in range(N):
        xys.append([int(x) for x in stdin.readline().rstrip().split()])
    print(solve(N, xys))
s = input()
if s[5] == 1:
    print("TBD")
else:
    if s[6]>4:
        print("Heisei")
    else:
        print("TBD")

### FIXED CODE ###

s = input()
if int(s[5]) == 1:
    print("TBD")
else:
    if int(s[6])<5:
        print("Heisei")
    else:
        print("TBD")
,M = map(int,input().split())
A = map(int,input().split())

B = [0]*M
B[0] = 1
tmp = 0
ans = 0



for a in A:
        tmp = (tmp+a)%M
        ans += B[tmp]
        B[tmp] += 1

print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
A = map(int,input().split())

B = {}
B[0] = 1
tmp = 0
ans = 0

for a in A:
        tmp = (tmp+a)%M
        ans += B.get(tmp,0)
        B[tmp] = B.get(tmp,0)+1

print(ans)
a, b = map(int,input())

if (a < 10 or b < 10):
  print(a*b)
else:
  print(-1)

### FIXED CODE ###

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

if (a < 10 and b < 10):
  print(a*b)
else:
  print(-1)
A,V = map(int,input().split())
B,W = map(int,input().split())
dist = abs(A-B)
diff = V-W
if dist > diff * T:
	print("NO")
else:
	print("YES")

### FIXED CODE ###

A,V = map(int,input().split())
B,W = map(int,input().split())

T = int(input())

dist = abs(A-B)
diff = V-W
if dist > diff * T:
	print("NO")
else:
	print("YES")
N = int(input())

table = [[] for _ in range(N)]
for i in range(N - 1):
	a, b = map(int, input().split())
	a -= 1
	b -= 1
	table[a].append(b)
	table[b].append(a)

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

c_list.sort()

d_list = [(len(table[i]), i) for i in range(N)]
d_list.sort()
i_list = [d_list[i][1] for i in range(N)]

scores = [None] * N
for i, s in zip(i_list, c_list):
	scores[i] = s

tree_top = 0
if N > 1:
	while len(table[tree_top]) == 1:
		tree_top = table[tree_top][0]

score = 0
def calc(cur, parent):
	global score
	s1 = scores[cur]
	for v in table[cur]:
		if v != parent:
			s2 = scores[v]
			if s1 < s2:
				score += s1
			else:
				score += s2
			calc(v, cur)

calc(tree_top, None)
print(score)
print(" ".join([str(s) for s in scores]))


### FIXED CODE ###

N = int(input())

table = [[] for _ in range(N)]
for i in range(N - 1):
	a, b = map(int, input().split())
	a -= 1
	b -= 1
	table[a].append(b)
	table[b].append(a)

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

c_list.sort()
c_list.reverse()

d_table = {}
d_rev = [None] * N
for i in range(N):
	d = len(table[i])
	if d in d_table:
		d_table[d].add(i)
	else:
		d_table[d] = {i}
	d_rev[i] = d

scores = [None] * N
for i in range(N):
	if i in d_table:
		n_set = d_table[i]
		while n_set:
			n = n_set.pop()
			scores[n] = c_list.pop()
			for n2 in table[n]:
				d = d_rev[n2]
				d_rev[n2] = d - 1
				n_set2 = d_table[d]
				if n2 in n_set2:
					n_set2.remove(n2)
					if d - 1 in d_table:
						d_table[d - 1].add(n2)
					else:
						d_table[d - 1] = {n2}

for i in range(N):
	if scores[i] == None:
		scores[i] = c_list[0]

score = 0
stack = [0]
visited = set()
visited.add(0)
while stack:
	cur = stack.pop()
	s1 = scores[cur]
	for n in table[cur]:
		if not n in visited:
			s2 = scores[n]
			if s1 < s2:
				score += s1
			else:
				score += s2
			stack.append(n)
			visited.add(n)

print(score)
print(" ".join([str(s) for s in scores]))
from sys import stdin
import numpy as np
input = stdin.readline

N = int(input())
A_list = list(map(int, input().split()))
ans_list =np.ones(N)
A_list = np.array(A_list)

for i in range(N-1):
    for j in range(i+1,N):
        if A_list[i] %  A_list[j] == 0:
            ans_list[i] = 0
            if (A_list[j] %  A_list[i] == 0):
                ans_list[j] = 0
        elif(A_list[j] %  A_list[i] == 0):
            ans_list[j] = 0
print(int(np.sum(ans_list)))


### FIXED CODE ###

from sys import stdin
import numpy as np
input = stdin.readline

N = int(input())
A_list = list(map(int, input().split()))
# ans_list =np.ones(N)
# A_list = np.array(A_list)

# for i in range(N-1):
#     for j in range(i+1,N):
#         if A_list[i] %  A_list[j] == 0:
#             ans_list[i] = 0
#             if (A_list[j] %  A_list[i] == 0):
#                 ans_list[j] = 0
#         elif(A_list[j] %  A_list[i] == 0):
#             ans_list[j] = 0
# print(int(np.sum(ans_list)))
A_set = list(set(A_list))
maxA =  A_set[-1]
dp = [1] * (( 10 ** 6) + 1)

cntli = [0] * (( 10 ** 6) + 1)
unique =[]
for i in A_list:
    cntli[i] += 1
for i in range((( 10 ** 6) + 1)):
    if cntli[i] == 1:
        unique.append(i)

for elem in A_set:
    for i in range(2 * elem,  10 ** 6 + 1, elem):
        dp[i] = 0

ans = 0
for i in unique:
    if not (dp[i] == 0):
        ans += 1

print(ans)