Harryxun/stf_run huggingface dataset:
import numpy as np
import itertools
 
H, W, K = list(map(int, input().split())) 
c = [input().split() for i in range(H)]
b=[]
d=[]
for i in range(len(c)):
  for item in c[i]:
    item_mod = item.replace("."  , "0")
    item_mod = item_mod.replace("#" , "1")
    b.append(item_mod)
  d.append(b)
  b=[]

C_arr = np.array(d)
 
In = np.array(list(itertools.product([0,1] , repeat=H)))
Out = np.array(list(itertools.product([0,1] , repeat=W)))
 
ans = 0
for i in range(2**H):
  for j in range(2**W):
    In_matrix = np.diag(In[i])
    Out_matrix = np.diag(Out[j])
    
    In_C = np.dot(In_matrix , C_arr)
    In_C_Out = np.dot(In_C , Out_matrix)
    
    ICO = In_C_Out.flatten()
    ICO = ICO.tolist()
    
    if ICO.count(1) == K:
      ans += 1
      
print(ans)

### FIXED CODE ###

H, W, K = list(map(int, input().split()))
 
c = [list(input()) for i in range(H)]
 
cnt = 0
for i in range(2**H):
    for j in range(2**W):
        cnt_black = 0
        for k in range(H):
            if (i >> k) & 1:
                continue
            for l in range(W):
                if (j >> l) & 1:
                    continue
                if c[k][l] == '#':
                    cnt_black += 1
        if cnt_black == K:
            cnt += 1
 
print(cnt)
N = int(input())
S = list(str(input()))
K = int(input())

SK = str(S[K])
for i in range(0,N):
    if S[i] == SK:
        pass
    else:
        S[i] = '*'
print(*S)

### FIXED CODE ###

N = int(input())
S = list(str(input()))
K = int(input())

SK = str(S[K-1])
for i in range(0,N):
    if S[i] == SK:
        pass
    else:
        S[i] = '*'
for j in S:
  print(j, end ="")
l=[int(input)for _ in range(n)]
print(min(l[0],l[1])+min(l[2],l[3]))

### FIXED CODE ###

l=[int(input()) for _ in range(4)]
print(min(l[0],l[1])+min(l[2],l[3]))
A,B,K = map(int,input().split())
cnt = 1
l = []
for i in range(2,max(A+1,B+1)):
    if A%i == 0 and B%i == 0:
        l.append(i)
if K == 1:
    ans = 1
else:
    ans = l[-K]
print(ans)

### FIXED CODE ###

A,B,K = map(int,input().split())
cnt = 0
l = []
for i in range(max(A+1,B+1),0,-1):
    if A%i == 0 and B%i == 0:
        cnt +=1
        if cnt == K:
            ans = i
            break
print(ans)
w,a,b=map(int,input())
print(b-(a+w) if b>a else a-(b+w) if b<a else 0)

### FIXED CODE ###

w,a,b=map(int,input().split())
print(b-(a+w) if b>a+w else a-(b+w) if b+w<a else 0)
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def popcnt(n):
    c = (n & 0x5555555555555555) + ((n>>1) & 0x5555555555555555)
    c = (c & 0x3333333333333333) + ((c>>2) & 0x3333333333333333)
    c = (c & 0x0f0f0f0f0f0f0f0f) + ((c>>4) & 0x0f0f0f0f0f0f0f0f)
    c = (c & 0x00ff00ff00ff00ff) + ((c>>8) & 0x00ff00ff00ff00ff)
    c = (c & 0x0000ffff0000ffff) + ((c>>16) & 0x0000ffff0000ffff)
    c = (c & 0x00000000ffffffff) + ((c>>32) & 0x00000000ffffffff)
    return c
N = int(readline())
S = readline().decode().rstrip()
one_cnt = S.count('1')
cnt = [0]*(one_cnt+1)
for i in range(1,one_cnt+1):
    j = i % popcnt(i)
    cnt[i] = 1 + cnt[j] 
    
n = int(S, 2)
for i in range(N):
    if S[i] == '1':
        tmp = n - 2**(N-i-1)
        tmp %= (one_cnt-1)
        print(1+cnt[tmp])
    else:
        tmp = n + 2**(N-i-1) 
        tmp %= (one_cnt+1)
        print(1+cnt[tmp])

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
S = readline().decode().rstrip()
one_cnt = S.count('1')
S_rev = S[::-1]
#one_modは元のビットが立ってるとき zero_modは逆
one_mod = 0
zero_mod = 0
#Nが大きすぎるため下の桁から順に計算
for i in range(N):
    if S_rev[i] == '1' and one_cnt - 1 != 0:
        one_mod += pow(2,i,one_cnt - 1)
        one_mod %= (one_cnt - 1)
        zero_mod += pow(2,i,one_cnt + 1)
        zero_mod %= (one_cnt + 1)

cnt = [0]*(one_cnt+1)
pop_cnt = [0]* (one_cnt+1)
for i in range(1,one_cnt+1):
    pop_cnt[i] = pop_cnt[i//2] + i%2
    j = i % pop_cnt[i]
    cnt[i] = 1 + cnt[j] 

one_pow2 = [1]*(N+1)
zero_pow2 = [1]*(N+1)
for i in range(1,N):
    if one_cnt-1 != 0:
        one_pow2[i+1] = one_pow2[i]*2 % (one_cnt - 1)
    zero_pow2[i+1] = zero_pow2[i]*2 % (one_cnt + 1)

for i in range(N):
    if S[i] == '1':
        if one_cnt-1 == 0:
            print(0)
        else:
            nxt = one_mod
            nxt -= one_pow2[N-i]
            nxt %= (one_cnt - 1)
            print(1+cnt[nxt])
    else:
        nxt = zero_mod
        nxt += zero_pow2[N-i]
        nxt %= (one_cnt + 1)
        print(1+cnt[nxt])
n, c = map(int, input().split())
x = [tuple(map(int, input().split())) for _ in range(n)]

S_cw = [0]
S_ccw = [0]
S_cw_return = [0]
S_ccw_return = [0]

for i in range(n):
    S_cw.append(S_cw[-1]+x[i][1])
    S_ccw.append(S_ccw[-1]+x[n-1-i][1])

for i in range(n):
    S_cw[i+1] -= x[i][0]
    S_ccw[i+1] -= c-x[n-1-i][0]
    S_cw_return.append(S_cw[i+1] - x[i][0])
    S_ccw_return.append(S_ccw[i+1] - (c-x[n-1-i][0]))

S_cw_return_max = [0]
S_ccw_return_max = [0]
for i in range(n):
    if S_cw_return[i+1] > S_cw_return_max[-1]:
        S_cw_return_max.append(S_cw_return[i+1])
    else:
        S_cw_return_max.append(S_cw_return_max[-1])

    if S_ccw_return[i+1] > S_ccw_return_max[-1]:
        S_ccw_return_max.append(S_ccw_return[i+1])
    else:
        S_ccw_return_max.append(S_ccw_return_max[-1])

ans = 0
for i in range(n+1):
    idx = n-i
    ans = max(ans, S_cw[i]+S_ccw_return_max[idx], S_ccw[i]+S_cw_return_max[idx])
print(ans)



### FIXED CODE ###

s = input()
print(700+s.count("o")*100)
from sys import stdin
import collections
def ip(): return [int(i) for i in stdin.readline().split()]
def sp(): return [str(i) for i in stdin.readline().split()]

n,m = ip()
d = collections.defaultdict(list)
seen = set()
for i in range(m):
    x,y = ip()
    if (x,y) in seen or (y,x) in seen:
        continue
    d[x].append(y)
    d[y].append(x)
    seen.add((x,y))
    seen.add((y,x))

def dfs(k, i, d, visited):
    k += 1
    visited.add(i)
    for j in d[i]:
        if j not in visited:
            visited, k = dfs(k, j, d, visited)
    return visited, k

visited = set()
ans = 0
for i in range(1, n+1):
    if i in visited: continue
    visited, k = dfs(0, i, d, visited)
    # print(f'{visited=} | {k=} | {ans=}')
    ans = max(ans, k)
print(ans)




### FIXED CODE ###

from sys import stdin
import collections
def ip(): return [int(i) for i in stdin.readline().split()]
def sp(): return [str(i) for i in stdin.readline().split()]

# 4 6
# 1 2
# 1 3
# 1 4
# 2 3
# 2 4
# 3 4

def find(d,x):
    root = x
    while root != d[root]:
        root = d[root]

    while x != root:
        nxt = d[x]
        d[x] = root
        x = nxt
    return d,root


def merge(d,s,x,y):
    d,x = find(d,x)
    d,y = find(d,y)
    if x == y: return d,s
    if s[x] > s[y]:
        s[x] += s[y]
        d[y] = d[x]
    else:
        s[y] += s[x]
        d[x] = d[y]
    return d,s


n,m = ip()
d = {i+1: i+1 for i in range(n)}
s = {i+1: 1 for i in range(n)}
seen = set()
for _ in range(m):
    # print(d,s)
    x,y = ip()
    if (x,y) in seen or (y,x) in seen: continue
    seen.add((x,y))
    seen.add((y,x))
    d,s = merge(d,s,x,y)
ans = 0
for i in s:
    ans = max(ans, s[i])
print(ans)
n,x,=map(int, input().split())
w_list = list(map(int, input().split()))
 
d=0
ans=0
for i in w_list:
   d=d+i
   ans++
   if(d>x):
       break
print(ans)

### FIXED CODE ###

n,x = map(int,input().split())
li = list(map(int,input().split()))
 
ans = 1
now = 0
 
for i in li:
    now += i
    if now <= x:
        ans += 1
    else:
        break
 
print(ans)
N, M = [int(i) for i in input().split().strip()]
A = [[int(i) for i in input().split().strip()] for j in range(N)]
C = [[int(i) for i in input().split().strip()] for j in range(M)]

ls1 = []
for i in range(N):
    ls2 = []
    for j in range(M):
        ls2.append(abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1]))
    a = min(ls2)
    ls1.append(ls2.index(a))
for i in ls1:
    print(i)

### FIXED CODE ###

N, M = [int(i) for i in input().split()]
A = [[int(i) for i in input().split()] for j in range(N)]
C = [[int(i) for i in input().split()] for j in range(M)]

ls1 = []
for i in range(N):
    ls2 = []
    for j in range(M):
        ls2.append(abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1]))
    a = min(ls2)
    ls1.append(ls2.index(a))
for i in ls1:
    print(i+1)
score = []
while True:
    line = raw_input()
    if line == "":
        break
    (a, b) = map(int, line.strip().split())
    score.append(a + b)
for i in score:
    print i

### FIXED CODE ###

import sys
score = []
for line in sys.stdin: 
    (a, b) = map(int, line.strip().split())
    score.append(a + b)
for i in score:
    print i
from heapq import*
(N,M),*t=[map(int,s.split())for s in open(0)]
q=[0]*M
v=[[]for _ in q]
z=0
for a,b in t:v[a-1]+=[b]
for i in v:
    for j in i:heappush(q,-j)
    z-=heappop(q)
print(z)


### FIXED CODE ###

from heapq import*
(N,M),*t=[map(int,s.split())for s in open(0)]
q=[0]*10**5
v=[[]for _ in q]
z=0
for a,b in t:v[a-1]+=[b]
for i in v[:M]:
	for j in i:heappush(q,-j)
	z-=heappop(q)
print(z)
str = input()
max = 0
count = 0
for chr in str:
  if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
    count += 1
   	if count > max:
      max = count
  else:
  	count = 0
print('{}'.format(max))

### FIXED CODE ###

str = input()
max = 0
count = 0
for chr in str:
    if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
        count += 1
        if count > max:
            max = count
    else:
        count = 0
print('{}'.format(max))
n=int(input())
stones=list(map(int, input.split()))
infini=(10**4)*(10**5)
dp = [infini for _ in range(n)]
dp[0]=stones[0]
dp[1]=abs(stones[0]-stones[1])
for pos in range(2, n):
   dp[pos] = min(dp[pos], abs(stones[pos] - min(dp[pos-1], dp[pos-2])))
print(dp[-1])

### FIXED CODE ###


n=int(input())
stones=list(map(int, input().split()))
infini=(10**4)*(10**5)
dp = [infini for _ in range(n)]
dp[0]=0

for pos in range(0, n-1):
   dp[pos+1] = min(dp[pos+1], dp[pos] + abs(stones[pos] - stones[pos+1]))
   if pos <= n-3:
      dp[pos+2] = min(dp[pos+2], dp[pos] + abs(stones[pos] - stones[pos+2]))
print(dp[-1])
import sys
n = int(input())
a = list(input())
b =list(map(int,a))
aa = list(set(b))
x = []
y = []
c = 1
for i in range(1,n+1):
    x.append(i)
for j in aa:
    if j in x and 1 in aa:
        pass
    else:
        print("-1")
        sys.exit()
for k in a:
    if int(k) == c:
        y.append(k)
        c = c + 1
print(len(a)-len(y))

### FIXED CODE ###

import sys
n = int(input())
a = list(map(int, input().split()))

num =  1
ans = 0
if 1 not in a:
    print(-1)
    sys.exit()
for i in a:
    if i == num:
        num += 1
    else:
        ans += 1
print(ans)
n = int(input())
a = list(map(int,input().split()))

ans = 0
for i in range(n):
    if i == 0:
        if a[0] > 0:
            f = "+"
        elif a[0] < 0:
            f = "-"
    else:
        if f == "+":
            if a[i] + sum(a[:i]) > 0:
                c = -1 - sum(a[:i])
                ans += abs(c - a[i])
                a[i] = c
                f = "-"
            else:
                if a[i] + sum(a[:i]) == 0:
                    a[i] -= 1
                    ans += 1
                f = "-"
        elif f == "-":
            if a[i] + sum(a[:i]) < 0:
                c = 1 - sum(a[:i])
                ans += abs(c - a[i])
                a[i] = c
                f = "+"
            else:
                if a[i] + sum(a[:i]) == 0:
                    a[i] += 1
                    ans += 1
                f = "+"
#print(a)
print(ans)


### FIXED CODE ###

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

ans = 0
f = 1
num = 0
for i in range(n):
    num += a[i]
    if f:
        if num <= 0:
            ans += 1 - num
            num = 1
        f = 0
    else:
        if num >= 0:
            ans += abs(-1 - num)
            num = -1
        f = 1

ans_2 = 0
f = 1
num = 0
for i in range(n):
    num += a[i]
    if f:
        if num >= 0:
            ans_2 += abs(-1 - num)
            num = -1
        f = 0
    else:
        if num <= 0:
            ans_2 += 1 - num
            num = 1
        f = 1

print(min(ans,ans_2))
import math
if(math.ceil(a/d)>=math.ceil(c/b)):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a, b, c, d = map(int, input().split())
if ((a + d - 1) // d) >= ((c + b - 1) // b):
    print("Yes")
else:
    print("No")
import math
cnt = 0
N = int(input())
for i in range(N):
    n = int(input())
    if n % 2:
        area = round(math.sqrt(n))
        prime_ng = 0
        for i in range(2, area + 1):
            if n % i == 0:
                prime_ng = 1
                break
            else:
        if prime_ng == 0:
            cnt += 1
    elif n == 2:
        cnt += 1
print(cnt)

### FIXED CODE ###

import math
n = int(input())
cnt = 0
for i in range(n):
    x = int(input())
    if x == 2:
        cnt += 1
    elif x <= 1\
    or x % 2 == 0:
        continue
    else:
        j = 3
        prime = "yes"
        while j <= math.sqrt(x):
            if x % j == 0:
                prime = "no"
                break
            else:
                j += 2
        if prime == "yes":
            cnt += 1
print(cnt)
N = int(input())
An = list(map(int, input().split()))
Q = int(input())

bc = [map(int, input().split()) for _ in range(Q)]
b, c = [list(i) for i in zip(*bc)]

for i in range(Q):
    for j, name in enumerate(An):
        if An[j] == b[i]:
            An[j] = c[i]
    
    print(sum(An))

### FIXED CODE ###

data = input()

if data.isupper():
    print("A")
elif data.islower():
    print("a")
n,a,b=map(int,input().split())
ans=0
for i in range(n+1):
    if a<=sum(map(int,str(i))<=b:
        ans+=i
print(ans)

### FIXED CODE ###

n,a,b=map(int,input().split())
ans=0
for i in range(n+1):
    if a<=sum(list(map(int,list(str(i)))))<=b:
        ans+=i
print(ans)
N, K = map(int, input().split())
s = input()
print(s[:K] + s[K:].capitalize.swapcase)

### FIXED CODE ###

N, K = map(int, input().split())
s = input()
print(s[:K-1] + s[K-1:].capitalize().swapcase())
x=int(input())

if x>0:
    if x%11>5:
        ans=(x//11)*2+2


    elif 1<=x%11<=5:
        ans=(x//11)*2+1

print(ans)

### FIXED CODE ###

x = int(input())
 
ans = (x//11)*2
remainder = x%11
if remainder == 0:
    print(ans)
elif 1 <= remainder <= 6:
    print(ans+1)
else:
    print(ans+2)
import math

a , b = map (int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

### FIXED CODE ###

import fractions

a , b = map (int,input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(a, b))
l = set(list(map, input().split()))
print(len(l))

### FIXED CODE ###

l = set(list(map(int, input().split())))
print(len(l))
import sys

sys.setrecursionlimit(100000)

MOD = 1000000007

state = [-1 for i in range(100010)]

def step_state(n, broken):
    if state[n] != -1:
        return state[n]

    if n == 0:
        state[0]=1
        return 1
    elif n == 1:
        if broken[1]:
            state[1]=0
            return 0
        else:
            state[1]=1
            return 1
    else:
        if broken[n - 1] and broken[n - 2]:
            state[n]=0
            return 0
        elif broken[n - 1]:
            state[n]=step_state(n-2, broken) % MOD
            return state[n]
        elif broken[n-2]:
            state[n] = step_state(n-1, broken) % MOD
            return state[n]
        else:
            state[n] = (step_state(n-1, broken)+step_state(n-2, broken)) % MOD
            return state[n]


if __name__ == '__main__':
    n, m = map(int, input().split())
    a = set([int(input()) for i in range(m)])
    broken = [False] * (n+1)
    for i in range(n+1):
        if i in a:
            broken[i] = True

    answer = step_state(n, broken)

    print(answer)


### FIXED CODE ###

if __name__ == '__main__':
   n, m = map(int,input().split())
   a = set([int(input()) for i in range(m)])

   MOD = 1000000007

   dp = [0 for i in range(n+1)]
   dp[0] = 1
   if 1 in a:
      dp[1] = 0
   else:
      dp[1] = 1

   for i in range(2,n+1):
      if (i-1 in a) and (i-2 in a):
         dp[i] = 0
      elif i-1 in a:
         dp[i] = dp[i-2] % MOD
      elif i-2 in a:
         dp[i] = dp[i-1] % MOD
      else:
         dp[i] = (dp[i-1] + dp[i-2]) % MOD

   print(dp[n])
a,b,c = map(int,input().split())
print(a*b//2)

### FIXED CODE ###

a,b,c= map(int,input().split())
print(a*b//2)
a,b=map(int,input().split())
print(max(a,b)*2-1

### FIXED CODE ###

a,b=map(int,input().split())
if a==b:print(2*a)
else:print(max(a,b)*2-1)
# coding: utf-8
from math import factorial
N, K = map(int, input().split())
mod = 10**9 + 7
def combination(n, r):
    if n >= r:
        return int(factorial(n) // (factorial(r) * factorial(n - r)))
    else:
        return 0

for i in range(1, K+1):
    print(combination(N-K+1, i) * combination(K-1, i-1)%mod)


### FIXED CODE ###

# coding: utf-8
S = list(input())
if len(set(S)) == 2:
    cnt = 0
    for s in set(S):
        if S.count(s) == 2:
            cnt += 1
    if cnt == 2:
        print("Yes")
        exit()
print("No")
area_input = input()
vertical = 0
side = 0
area_list = area_input.split(',')

if 1 <= vertical && side <= 100:
  for i in area_list:
    vertical = area_list[0]
    side = area_list[1]
  
  area = int(vertical) * int(side)
  langth = 2 * (int(vertical) + int(vertical))
  
  print(str(area) + " " + str(langth))



### FIXED CODE ###

number = input()

number_list = number.split(' ')

a = int(number_list[0])
b = int(number_list[1])

if 1 <= a <= 100 and 1 <= b <= 100:
    menseki = a * b
    nagasa = 2 * (a + b)

    print(str(menseki) + " " + str(nagasa))
arg = raw_input().split()

num = int(arg[0]) * int(arg[1])

if num % 2 == 0:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

arg = input().split()

num = int(arg[0]) * int(arg[1])

if (num % 2) == 0:
  print('No')
else:
  print('Yes')
L, R = map(int, input().split())
import numpy as np
LL = L%2019
RR = R%2019
min = 2019


for i in range(LL, RR+1):
  for j in range(i+1, RR+1):
    if (i*j)%2019 == 0:
      min = 0
      break
    elif (i*j)%2019 < min:
      min= (i*j)%2019


print(min)


### FIXED CODE ###

import sys
import fractions
from collections import Counter, deque, defaultdict
from math import factorial
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

a,b,c = MAP()
print(min(a*b,c))
n = int(input())
xy = list()
for i in range(n):
  xy.append(list(map(int, input().split())))
  
dsum = 0
dist_1 = [[0] * n for k in range(n)]
for i in range(n-1):
  for J in range(i+1, n):
    dist = ((xy[i][0] - xy[j][0] ** 2 + (xy[i][1] - xy[j][1]) ** 2)**(1/2)
    dist_1[i][j] = dist        
            

### FIXED CODE ###

n = int(input())
xy = list()
for i in range(n):
    xy.append(list(map(int,input().split())))
 
dsum = 0
dist_l = [[0] * n for k in range(n)]
for i in range(n-1):
    for j in range(i+1, n):
        dist = ((xy[i][0] - xy[j][0]) ** 2 + (xy[i][1] - xy[j][1]) ** 2) ** (1/2)
        dist_l[i][j] = dist
        dist_l[j][i] = dist
        dsum = dsum + dist
 
ans = dsum * (n-1) / (n * (n-1) / 2)
 
print(ans)
n, m = map(int, input().split())
q = [list(map(int, input().split())) for _ in range(m)]

ans = [0]*n
judge = [0]*n

for i in range(m):
    a_list = q[i]
    rank = a_list[0] - 1
    num = a_list[1]

    if judge[rank] == 0:
        judge[rank] = 1
    else:
        if ans[rank] == num:
            continue
        else:
            print(-1)
            exit()

    ans[rank] = num

for_p = ['0']*m
for i in range(m):
    if judge[i] == 1:
        for_p[i] = str(ans[i])

if for_p[0] == '0':
    print(-1)
else:
    print(int(''.join(for_p)))


### FIXED CODE ###

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

ans = ['0']*n
judge = [0]*n

for i in range(m):
    a_list = q[i]
    rank = a_list[0] - 1
    num = str(a_list[1])

    if judge[rank] == 0:
        judge[rank] = 1
        ans[rank] = num
    else:
        if ans[rank] == num:
            continue
        else:
            print(-1)
            exit()


if ans[0] == '0' and judge[0] == 1 and n != 1:
    print(-1)
elif ans[0] == '0' and n != 1:
    ans[0] = '1'
    print(int(''.join(ans)))
else:
    print(int(''.join(ans)))
import bisect
k=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
i=0
n=k
while i<n:
    s=l[-1]
    b=1
    while b<=s:
        b*=2
    g=b-s
    p=bisect.bisect_left(l,g)
    if p==len(l):
        l.pop(-1)
        i+=1
        continue
    else:
        if l[p]==g:
            l.pop(-1)
            l.pop(p)
            i+=2
            ans+=1
        else:
            l.pop(-1)
            i+=1
print(ans)


### FIXED CODE ###

from bisect import bisect_left
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
A.sort()
t=0
for i in range(N):
    while 2**t<=A[i]:
        if 2**t<=A[i]<2**(t+1):
            break
        t+=1
    B[i]=2**(t+1)-A[i]
i=N-1
count=0
flag=[0]*N
for i in range(N-1,0,-1):
    if flag[i]==1:
        continue
    flag[i]=1
    b=bisect_left(A,B[i])
    if A[b]==B[i] and flag[b]==0:
        flag[i]=1
        flag[b]=1
        A[b]-=1
        count+=1
print(count)
import numpy as np

in_num = list(map(int, input().split()))
in_num2 = list(map(int, input().split()))
n = in_num[0]
k = in_num[1]
a = np.asarray(in_num2)
#n = 10**5
#k = 10**12
#a = np.asarray(np.arange(10**12))
if False:# k == 0 :
    print(np.sum(a))
    exit
else:
    max = 0
    ktmp = 0
    flag = 1 if k == 0 else 0
    i = 1
    while True:
        tmp = len(a[a%2==1])
        ktmp += i if tmp > n - tmp or flag == 1 else 0
        if ktmp > k:
            break
        tmp = tmp if tmp > n - tmp or flag == 1 else n - tmp 

        max += tmp * i
        #print(tmp,max,i,np.max(a))
        a = np.trunc(a / 2)
        i = i * 2
        if i > k:
            flag = 1
            if 0 ==  np.max(a):
                break

    print(max)

### FIXED CODE ###

import numpy as np

m = list(map(int, input().split()))
t = m[0]
x = m[1]
print(t/x)
x = int(input())
a = False
while a = True:
  b = range(x) + 1
  c = x/b
  d = [d.is_integer() for d in c[1:-1]]
  if not any(d):
    a = True
    break    
  else:
    x = x + 1
print(x)

### FIXED CODE ###

x = int(input())
a = False
while a == False:
  b = list(range(1,x) ) 
  c = [x/c for c in b]
  d = [d.is_integer() for d in c[1:-1]]
  if not any(d):
    a = True
    break    
  else:
    x = x + 1
print(x)
M=int(input())
ans=0
A=[]
def f(x):
  e=str(x)
  n=len(e)
  l=0
  for i in e:
    l+=int(i)
  if l<10:
    return l
  else:
    f(l)
  
for i in range(M):
  d,c=map(int,input().split())
  ans+=(c-1)+d*c//10
  A.append(f(d*c))
  
ans+=len(A)-1
ans+=(sum(A)-1)//9
print(ans)

### FIXED CODE ###

M=int(input())
k,g=0,0
for i in range(M):
  d,c=map(int,input().split())
  k+=c
  g+=c*d
print((g-1)//9+(k-1))
import sys
import math

x_list = []

for line in sys.stdin.readlines():
  x_list.append(int(line.strip()))

count = 0

num_list.remove(x_list[0])

for i in x_list:
  flag = 0
  for j in range(2, math.sqrt(i)+1):
    if i % j == 0:
      flag = 1
      break
    if flag == 0:
      count += 1

print count
    

### FIXED CODE ###

import sys
import math

x_list = []

for line in sys.stdin.readlines():
  x_list.append(int(line.strip()))

count = 0

x_list.remove(x_list[0])

for i in x_list:
  flag = 0
  for j in range(2, int(math.sqrt(i))+1):
    if i % j == 0:
      flag = 1
      break
  if flag == 0:
    count += 1

print count
n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split())
c=[0]*3
for i in p:
       if i <=a:
        c[0] +=1
       elif i>b:
        c[2] +=1
       else:
        c[1]+=1
print(min(c))

### FIXED CODE ###

n = int(input())
a,b = map(int,input().split())
l = list(map(int,input().split()))
c = [0]*3
for i in l:
    if i <= a:
        c[0] += 1
    elif i > b:
        c[2] += 1
    else:
        c[1] += 1
print(min(c))