Harryxun/stf_run huggingface dataset:
n = int(input())
data = []
for i in range(n):
    data.append(list(map(int, input().split())))
dif = dict()
for i in range(n):
    for j in range(i+1, n):
        x = data[i][0] - data[j][0]
        y = data[i][1] - data[j][1]
        if (x,y) in dif:
            dif[(x,y)] += 1
        else:
            dif[(x,y)] = 1
print(n - max([dif[i] for i in dif.keys()]))
        
        



### FIXED CODE ###

n = int(input())
data = []
for i in range(n):
    data.append(list(map(int, input().split())))
dif = dict()
data.sort()
for i in range(n):
    for j in range(i+1, n):
        x = data[i][0] - data[j][0]
        y = data[i][1] - data[j][1]
        if (x,y) in dif:
            dif[(x,y)] += 1
        else:
            dif[(x,y)] = 1
if len(dif.keys()) == 0:
    print(n)
    exit()
print(n - max([dif[i] for i in dif.keys()]))
import math
import numpy as np
X=int(input())
count=0
atcor=100


while True:
    if atcor==X:
        print(count)
        break
    else:
        p=atcor/100
        atcor=atcor+p
        atcor=math.floor(atcor)
        count+=1


### FIXED CODE ###

import math

X=int(input())
count=0
# count=float(count)
atcor=100
atcor=int(atcor)


while True:
    
    if atcor>=X:
        print(count)
        break
    else:
        p=atcor/100
        atcor=atcor+p
        atcor=math.floor(atcor)
        count+=1
n=int(input())
a=list(map(int,input().split()))
minmax=[]
ninli=[]
naxli=[]
nin=a[0]
nax=0

for i in range(n):
    if a[0]<a[i]:
        up=True
        nin=a[0]
        break
    elif a[0]>a[i]:
        up=False
        break

total=1000

for i in range(1,n-1):
    if up:
        if a[i-1]<=a[i] and a[i]>a[i+1]:
            total+=(total//nin)*(a[i]-nin)
            up=False
    else:
        if a[i-1]>=a[i] and a[i]<a[i+1]:
            nin=a[i]
            up=True
if nin<a[n-1]:
    total+=(total//nin)*(a[n-1]-nin)
print(total)

### FIXED CODE ###

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

for i in range(n):
    if a[0]<a[i]:
        up=True
        nin=a[0]
        break
    elif a[0]>a[i]:
        up=False
        nin=a[i]
        break
    if i==n-1:
        print(1000)
        exit()

total=1000

for i in range(1,n-1):
    if up:
        if a[i-1]<=a[i] and a[i]>a[i+1]:
            total+=(total//nin)*(a[i]-nin)
            up=False
    else:
        if a[i-1]>=a[i] and a[i]<a[i+1]:
            nin=a[i]
            up=True
if nin<a[n-1]:
    total+=(total//nin)*(a[n-1]-nin)
print(total)
a = input()
b = list(map(int,input().split()))
c = b.sort()
d = 0

if a <= 2:
  print("0")
elif :
  for i in len(b):
    for j in (i+1,len(b)):
      for k in (k+1,len(b)):
        if c[i]+c[j] > c[k]:
          d += 1
  print(str(d))         
        

### FIXED CODE ###

a = int(input())
b = list(map(int,input().split()))
b.sort()
d = 0
 
if a <= 2:
  print("0")
else :
  for i in range(len(b)):
    for j in range(i+1,len(b)):
      for k in range(j+1,len(b)):
        if b[i]+b[j] > b[k] and b[i] != b[j] and b[j] != b[k]:
          d += 1
  print(str(d))
n,k=map(int,input().split())
loop_=[1]
l_set=set()
lst=list(map(int,input().split()))

tar=None
for i in range(k):
    num=lst[loop_[-1]-1]
    if num in l_set:
        tar=num
        break
    else:
        loop_.append(num)
        l_set.add(num)

if tar==None:
    print(loop_[k])
    exit()    
loop__=loop_[loop_.index(tar):]
 
if k<=len(loop_):
    print(loop_[k])
else:
    num=k+1-len(loop_)
    print(loop__[num%len(loop__)-1])

### FIXED CODE ###

n,k=map(int,input().split())
loop_=[1]
l_set=set()
lst=list(map(int,input().split()))

tar=None
for i in range(k):
    num=lst[loop_[-1]-1]
    if num in l_set:
        tar=num
        break
    else:
        loop_.append(num)
        l_set.add(num)

if tar==None:
    print(loop_[k])
    exit()    
loop__=loop_[loop_.index(tar):]

num=k+1-len(loop_)
try:
  print(loop__[num%len(loop__)-1])
except:
  print(1)
A,B,C=map(int,input().split())
ans='NO'
if A[-1]==B[0] and B[-1]==C[0]:
  ans='YES'
print(ans)

### FIXED CODE ###

A,B,C=input().split()
ans='NO'
if A[-1]==B[0] and B[-1]==C[0]:
  ans='YES'
print(ans)
import math

n = int(input())
a = [int(i) for i in input().split()]
#print(n)
prefix,suffix=[0]*n,[0]*n
prefix[0]=a[0]
suffix[n-1]= a[n-1]
#print(prefix)
for i in range(1,n):
    prefix[i]= math.gcd(prefix[i-1],a[i])
    suffix[n-i-1]= math.gcd(suffix[n-i],a[n-i-1])
    pass
maxgcd= max(suffix[1],prefix[-2])
for i in range(1,n-1):
    maxgcd = max(maxgcd, math.gcd(prefix[i-1],suffix[i+1]))
print(maxgcd)

### FIXED CODE ###

import math
def gcd(x, y): 
   while(y): 
       x, y = y, x % y 
  
   return x 
n = int(input())
a = [int(i) for i in input().split()]
#print(n)
prefix,suffix=[0]*n,[0]*n
prefix[0]=a[0]
suffix[n-1]= a[n-1]
#print(prefix)
for i in range(1,n):
    prefix[i]= gcd(prefix[i-1],a[i])
    suffix[n-i-1]= gcd(suffix[n-i],a[n-i-1])
    pass
maxgcd= max(suffix[1],prefix[-2])
for i in range(1,n-1):
    maxgcd = max(maxgcd, gcd(prefix[i-1],suffix[i+1]))
print(maxgcd)
M = 50100
p = [1]*M; p[0],p[1]=0,0;
pm = [0]*M; pM = [0]*M;
for i in range(2,M):
    if p[i]:
        for j in range(i*i,M,i): p[j] = 0
num = -1
for i in range(1,M):
    pm[i] = num
    if p[i]: num = i
num = -1
for i in range(M-1,2,-1):
    pM[i] = num
    if p[i]: num = i
while 1:
    n = input()
    if n==0: break
    print pm[n],pM[n]

### FIXED CODE ###

M = 50100
p = [1]*M; p[0],p[1]=0,0;
pm = [0]*M; pM = [0]*M;
for i in range(2,M):
    if p[i]:
        for j in range(i*i,M,i): p[j] = 0
num = -1
for i in range(1,M):
    pm[i] = num
    if p[i]: num = i
num = -1
for i in range(M-1,2,-1):
    pM[i] = num
    if p[i]: num = i
while 1:
    try:
        n = input()
        print pm[n],pM[n]
    except EOFError:
        break
import sys

class Node:
    def __init__(self, key):
        self.key = key
        self.right = None
        self.left = None

def insert(T, z): #z is node which you would like to insert                                
        #initialization                                                                    
    y = None #parent of x                                                                  
    x = T

        #search                                                                            
    while(x!=None):
        y = x
        if(z.key < x.key):
            x = x.left
        else:
            x = x.right

	#insert                                                                            
    if(y==None):
        T = z
    elif(z.key < y.key):
	y.left = z
    else:
        y.right = z

    return T

def inorder_walk(node):
    if node.left:
	inorder_walk(node.left)
    print('', node.key, end='')
    if node.right:
	inorder_walk(node.right)


def preorder_walk(node):
    print('', node.key, end='')
    if node.left:
        preorder_walk(node.left)
    if node.right:
	preorder_walk(node.right)


T = None
num = int(sys.stdin.readline())

for _ in range(num):
    cmd = sys.stdin.readline()
    if(cmd.startwith('i')):
        n = Node(int(cmd[:7]))
        T = insert(T, n)
    else:
        inorder_walk(T)
        preorder_walk(T)

### FIXED CODE ###

#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
 
 
class Node(object):
    def __init__(self, key=None):
        self.key = key
        self.parent = None
        self.left = None
        self.right = None
 
 
def tree_insert(top, z):
    y = None
    x = top
    while isinstance(x, Node):
        y = x
        if z.key < x.key:
            x = x.left
        else:
            x = x.right
    z.parent = y
    if y is None:
        top = z
    elif z.key < y.key:
        y.left = z
    else:
        y.right = z
    return top
 
 
def inorder_walk(node):
    if node.left:
        inorder_walk(node.left)
    print('', node.key, end='')
    if node.right:
        inorder_walk(node.right)
 
 
def preorder_walk(node):
    print('', node.key, end='')
    if node.left:
        preorder_walk(node.left)
    if node.right:
        preorder_walk(node.right)
 
 
n = int(stdin.readline())
 
top = None
for _ in range(n):
    cmd = stdin.readline()
    if cmd.startswith('i'):
        key = int(cmd[7:])
        #assert -2000000000 <= key <= 2000000000
        top = tree_insert(top, Node(key))
    else:
        inorder_walk(top)
        print()
        preorder_walk(top)
        print()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

N, M = map(int, input().split())
A = [int(x) for x in input().split()]

ntom = [0,2,5,5,4,5,6,3,7,6]

mtoa = {}
for a in A:
    m = ntom[a]
    mtoa[m] = max(mtoa.get(m, 0), a)

ms = mtoa.keys()
dp = [None] * (N+1)
dp[0] = 0
for i in ms:
    dp[i] = 1
for i in range(2, N+1):
    x = [dp[i-x] for x in ms if i > x and dp[i-x]]
    if x:
        dp[i] = max(x) + 1

mms = sorted([(v, m) for m, v in mtoa.items()], reverse=True)
ans = ''
left = N
while left:
    for v,m in mms:
        if left >= m and dp[left - m] is not None and dp[left] == dp[left - m] + 1:
            left -= m
            ans += str(v)
            break
        
print(ans)

### FIXED CODE ###

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

N, M = map(int, input().split())
A = [int(x) for x in input().split()]

ntom = [0,2,5,5,4,5,6,3,7,6]

mtoa = {}
for a in sorted(A):
    mtoa[ntom[a]] = a

ms = sorted(mtoa.keys(), key=lambda x: mtoa[x], reverse=True)
dp = [0] + [float('-inf')] * N
for i in range(min(ms), N+1):
    dp[i] = max(dp[i-x] for x in ms if i >= x) + 1

ans = []
left = N
while left:
    for m in ms:
        if left >= m and dp[left] == dp[left - m] + 1:
            left -= m
            ans.append(mtoa[m])
            break
        
print(*ans, sep='')
n = int(input())

def min_walk(n):
    out = []
    for a in range(1, int(n**0.5)):
        if n % a == 0:
            out.append(a + (n//a) - 2)

    return min(out)


print(min_walk(n))

### FIXED CODE ###

n = int(input())

def min_walk(n):
    out = []
    for a in range(1, int(n**0.5)+1):
        if n % a == 0:
            out.append(a + (n//a) - 2)

    return min(out)


print(min_walk(n))
N,K = map(int,input().split())
x=list(map(int,input().split()))
for i in range(len(x)):
    if x[i]>=0:
        zp=i
        if 0 not in x:
            x.insert(i,0)
        break
for i in range(len(x)):
    if x[i]<=0:
        x[i]=abs(x[i])

ans=10**11
for k in range(zp+K-len(x)+1,min(zp,K)+1):
    ans=min( ans, x[zp-k]+ x[zp+K-k]+ min(x[zp-k],x[zp+K-k]) )

print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
x=list(map(int,input().split()))
flag=0

ans=10**11
for i in range(0,len(x)-K+1):
    if x[i]*x[K-1+i] <0:
        anss=abs(x[i])+ abs(x[K-1+i])
        anss += min(abs(x[i]),abs(x[K-1+i]))
    else:
        anss=max(abs(x[i]), abs(x[K-1+i]))
    ans=min( ans, anss)

print(ans)
s=list(input())
cnt=0
ans=0
lis=["ATCG"]

for i in range(len(s)):
  if s[i] in lis:
    cnt+=1
    ans=max(ans,cnt):
  else:
    cnt=0
print(ans)

### FIXED CODE ###

s=list(input())
cnt=0
ans=0
lis=list("ATCG")

for i in s:
  if i in lis:
    cnt+=1
    ans=max(ans,cnt)
  else:
    cnt=0
print(ans)
n=int(input())
A=list(map(int,input().split()))

L,R=[0]*n,[0]*n
L[0],R[-1]=A[0],A[-1]

from math import gcd

for i in range(1,n):
    L[i]=gcd(A[i],L[i-1])
for i in range(n-2,-1,-1):
    R[i]=gcd(A[i],R[i+1])

ans=max([L[-2],R[1]]+[gcd(L[i-1],R[i+1])for i in range(1,n-1)])
print(ans)

### FIXED CODE ###

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

L,R=[0]*n,[0]*n
L[0],R[-1]=A[0],A[-1]

from fractions import gcd

for i in range(1,n):
    L[i]=gcd(A[i],L[i-1])
for i in range(n-2,-1,-1):
    R[i]=gcd(A[i],R[i+1])

ans=max([L[-2],R[1]]+[gcd(L[i-1],R[i+1])for i in range(1,n-1)])
print(ans)
import copy
S=list(input())
S1 = "".join(S)
T=list(input())
T1 = "".join(T)
F = ["?"]*len(T)
F1 = "".join(F)
l =[]
M =[]
index =[]
B = copy.deepcopy(S)
while -1<S1.find(F1):
    a = S1.find(F1)
    index.append(a)
    B[a] ="a"
    S1="".join(B)
S1 ="".join(S)
for i in range(len(S)-len(T)+1):
    if S[i]==T[0]:
        l.append(i)
if 0<len(l):
    for i in l:
        A = copy.deepcopy(S)
        c = A[i:len(T)+i]
        while "?" in c:
            c[c.index("?")] = T[c.index("?")]
        if c==T:
            A = copy.deepcopy(S)
            A[i:len(T)+i] = c
            while "?"in A:
                A[A.index("?")]="a"
            M.append(A)

for i in range(len(S)-len(T)+1):
    if S[i] =="?":
        A = copy.deepcopy(S)
        c = A[i:len(T)+i]
    while "?" in c:
        c[c.index("?")] = T[c.index("?")]
    if c==T:
        A = copy.deepcopy(S)
        A[i:len(T)+i] = c
        while "?"in A:
            A[A.index("?")]="a"
        M.append(A)
if 0<len(index):
    for i in index:
        A = copy.deepcopy(S)
        A[i:len(T)+i] = T
        while "?"in A:
            A[A.index("?")]="a"
        M.append(A)
if 0<len(M):
    M.sort()
    print("".join(M[0]))
else:
    print("UNRESTORABLE")

### FIXED CODE ###

import copy
S=list(input())
S1 = "".join(S)
T=list(input())
T1 = "".join(T)
F = ["?"]*len(T)
F1 = "".join(F)
l =[]
M =[]
index =[]
B = copy.deepcopy(S)
for i in range(len(S)-len(T)+1):
    A = copy.deepcopy(S)
    c = A[i:len(T)+i]
    while "?" in c:
        c[c.index("?")] = T[c.index("?")]
    if c==T:
        A = copy.deepcopy(S)
        A[i:len(T)+i] = c
        while "?"in A:
            A[A.index("?")]="a"
        M.append(A)
if 0<len(M):
    M.sort()
    print("".join(M[0]))
else:
    print("UNRESTORABLE")
import math


N = int(input())
X_bin = input()

X_int = int(X_bin, 2)  # bin => int


def calc_bin_cnt(next_int):
    '''
    next_bin = bin(next_int)[2:]
    # popcount
    cnt = 0
    for i in next_bin:
        if i == '1':
            cnt += 1
    '''
    cnt = 0
    n = int(math.log2(next_int))
    for i in range(n, -1, -1):
        if next_int >= 2**i:
            next_int -= 2**i
            cnt += 1
    return cnt


def calc_ans(next_int, cnt=None):
    if next_int == 0:
        return 0
    if cnt is None:
        cnt = calc_bin_cnt(next_int)
    next_int = next_int % cnt
    if next_int > 0:
        ans = calc_ans(next_int) + 1
    else:
        ans = 1
    return ans


X_cnt = calc_bin_cnt(X_int)
for i in range(N):
    if X_bin[i] == '1':
        print(calc_ans(X_int - (2**(N-i-1)), X_cnt-1))
    else:
        print(calc_ans(X_int + (2**(N-i-1)), X_cnt+1))


### FIXED CODE ###

N = int(input())
X_bin = input()
#N = 10**5
#X_bin = '1' * N

X_int = int(X_bin, 2)  # bin => int


def calc_bin_cnt(next_int):
    if next_int == 0:
        return 0
    next_bin = bin(next_int)[2:]
    # popcount
    cnt = 0
    for i in next_bin:
        if i == '1':
            cnt += 1
    return cnt


def calc_ans(next_int, cnt=None):
    if next_cnt == 0:
        return 0
    if next_int == 0:
        return 1
    if cnt is None:
        cnt = calc_bin_cnt(next_int)
    next_int = next_int % cnt
    if next_int > 0:
        ans = calc_ans(next_int) + 1
    else:
        ans = 1
    return ans


X_cnt = calc_bin_cnt(X_int)
f_p = X_int % (X_cnt+1)
if X_cnt-1 == 0:
    f_m = 0
else:
    f_m = X_int % (X_cnt-1)
for i in range(N):
    if X_bin[i] == '1':
        next_cnt = X_cnt - 1
        if next_cnt == 0:
            next_int = 0
        else:
            next_int = f_m - pow(2, (N-i-1), next_cnt)  # マイナスでも正しく求まる？
    else:
        next_cnt = X_cnt + 1
        next_int = f_p + pow(2, (N-i-1), next_cnt)
    print(calc_ans(next_int, next_cnt))
    #calc_ans(next_cnt, next_cnt)
from functools import lru_cache
import sys

sys.setrecursionlimit(10**5)

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

@lru_cache(maxsize=None)
def recur(i):
    if i == N - 1:
        return 0
    return min(abs(h[i] - h[i + 1]) + recur(i + 1), abs(h[i] - h[min(N - 1, i + 2)]) + recur(min(N - 1, i + 2)))

print(recur(0))

# dp = [0]*(N + 1)
# for i in range(N):


### FIXED CODE ###

from functools import lru_cache
import sys

sys.setrecursionlimit(10**6)

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

@lru_cache(maxsize=None)
def recur(i):
    if i == N - 1:
        return 0
    return min(abs(h[i] - h[i + 1]) + recur(i + 1), abs(h[i] - h[min(N - 1, i + 2)]) + recur(min(N - 1, i + 2)))

print(recur(0))

# dp = [0]*(N + 1)
# for i in range(N):
A, B, C = sorted(map(input().split()))
print(10*C+A+B)

### FIXED CODE ###

A, B, C = sorted(map(int, input().split()))
print(10*C+A+B)
A=input()
B=input()
if(A[0]==B[2]&&A[1]==B[1]&&A[2]=B[0]):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

A=input()
B=input()
if(A[0]==B[2] and A[1]==B[1] and A[2]==B[0]):
  print("YES")
else:
  print("NO")
import math
r=float(input())
pritn(float(r*r*pi),float(2*r*pi))


### FIXED CODE ###

from math import pi
r=float(input())
print("{0:.6f}".format(r*r*pi),"{0:.6f}".format(2*r*pi))
import math

N = int(input())
cnt = 0
if N == 2:
    cnt = 1
elif N == 3:
    cnt = 3
elif N > 3:
    cnt = 3
    for i in range(1,N-1):
        A = N-i
        rA = math.sqrt(A)
        intA = math.floor(rA)
        if rA == intA:
            cnt -= 1
        if intA == 1:
            cnt += 1
        else:
            for j in range(1,intA+1):
                if A%j == 0:
                    cnt += 2

print(cnt)

### FIXED CODE ###

S = input()
l = len(S)
if S[l-1]=='s':
    S = S + 'es'
else:
    S = S + 's'
print(S)
s=input()
t=input()

li=[]
for i in range(len(s)-len(t)+1):
    if s[i]==t[0] or s[i]=='?':
        check=1
        tid=1
        while True:
            if s[i+1] ==t[tid] or s[i+1]=='?':

                check+=1
                i+=1
                tid+=1

                if check==len(t):
                    li.append(s[:i-len(t)+1]+t+s[i+1:])
                    break
            else:
                break

li2=[]      

for i in li:

    li2.append(i.replace('?','a'))
    

li2.sort()


print(li2[0] if li2 else 'UNRESTORABLE')

### FIXED CODE ###

s=input()
t=input()

li=[]
for i in range(len(s)-len(t)+1):
    if s[i]==t[0] or s[i]=='?':
        check=1
        tid=1
        if len(t)==1:
            li.append(s[:i-len(t)+1]+t+s[i+1:])
        else:

            while True:
                if s[i+1] ==t[tid] or s[i+1]=='?':

                    check+=1
                    i+=1
                    tid+=1

                    if check==len(t):
                        li.append(s[:i-len(t)+1]+t+s[i+1:])
                        break
                else:
                    break

li2=[]      

for i in li:

    li2.append(i.replace('?','a'))
    

li2.sort()


print(li2[0] if li2 else 'UNRESTORABLE')
x,y=map(int,input().split())
if x=y:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

x,y=map(int,input().split())
if x==y:
    print("Yes")
else:
    print("No")
n,m=map(int,input().split())
if n<100:
    print(w[100])
l=[int(i) for i in input().split()]
w=[0]
for i in l:
    #d.append(i+d[-1])
    w.append((i+w[-1])%m)
ans=0
d={}
for i in w:
    if i in d:
        d[i]+=1
    else:
        d[i]=1
#print(w,d)
for i in d:
    ans+=d[i]*(d[i]-1)
"""
for i in range(n):
    for j in range(i+1,n+1):
        p=abs(d[j]-d[i])
        if p%m==0: ans+=1
"""
print(ans//2)

### FIXED CODE ###

n,m=map(int,input().split())
l=[int(i) for i in input().split()]
w=[0]
for i in l:
    w.append((i+w[-1])%m)
ans=0
d={}
for i in w:
    if i in d:
        d[i]+=1
    else:
        d[i]=1
for i in d:
    ans+=d[i]*(d[i]-1)
print(ans//2)
import math
a = int(input())
temp = 3.14
val = str(2*temp*a)
st=""
ind=0
for j in range(len(val)):
	if(val[j]=="."):
		ind=j
		st+="."
		break
	else:
		st+=val[j]
st+=val[ind+1]
st+=val[ind+2]

print(st)


### FIXED CODE ###

import math
a = int(input())
val = 2*math.pi*a
print(val)
N = int(input())
A = [-1].extend(list(map(int, input().split()))) # たべた料理
B = [-1].extend(list(map(int, input().split()))) # 料理の満足度
C = [-1].extend(list(map(int, input().split()))) # i -> i+1ボーナス

manzoku = 0

for i in range(1, N+1):
  manzoku += B[A[i]]
  if A[i-1] + 1 == A[i]:
    manzoku += C[A[i-1]]

print(manzoku)

### FIXED CODE ###

N = int(input())
A = [-1]
A.extend(list(map(int, input().split()))) # たべた料理
B = [-1]
B.extend(list(map(int, input().split()))) # 料理の満足度
C = [-1]
C.extend(list(map(int, input().split()))) # i -> i+1ボーナス

manzoku = 0

for i in range(1, N+1):
    manzoku += B[A[i]]
    if A[i-1] + 1 == A[i]:
        manzoku += C[A[i-1]]

print(manzoku)
import heapq,sys


def main():
    input = sys.stdin.readline
    X, Y, Z, K = map(int, input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    C = list(map(int,input().split()))
    
    #A+Bでのベスト枠K個求めるO(XYlogK)
    AandB = []
    for i in range(X):
        for j in range(Y):
            heapq.heappush(AandB, A[i] + B[j])
            #要素がK+1個以上なら一々はじく！！！ことでO(logK)
            if len(AandB) > K:
                heapq.heappop(AandB)
    #上のとCでのベスト枠K個を求める(ZKlogK)
    heap_queue = []
    for k in range(Z):
        for h in range(len(AandB)):
            heapq.heappush(heap_queue,C[k] + AandB[h])
            if len(heap_queue) > K:
                heapq.heappop(AandB)
    heap_queue.sort(reverse = True)
    for e in heap_queue:
        print(e)
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys,bisect
input = sys.stdin.readline

x,y,z,k = map(int,input().split())
a = tuple(map(int,input().split()))
b = tuple(map(int,input().split()))
c = list(map(int,input().split()))

ab = []
for e in a:
    for w in b:
        ab.append(e+w)
ab.sort()

ok = -1
ng = 10**12
while abs(ok-ng)>1:
    mid = (ok+ng)//2
    cnt = 0
    for e in c:
        cnt += len(ab)-bisect.bisect_left(ab,mid-e)
    if cnt >= k:
        ok = mid
    else:
        ng = mid

res = []
for e in c:
    ind = bisect.bisect_left(ab,ok-e)
    for i in range(ind,len(ab)):
        res.append(e+ab[i])
res.sort()
for i in range(1,k+1):
    print(res[-i])
n = int(input())
sn = sum(list(map(int, n.split())))
if n % sn == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = input()
sn = sum([int(i) for i in list(n)])
n = int(n)
if n % sn == 0:
  print("Yes")
else:
  print("No")
A, B, C, D = map(int, input().split())
def div_num(a, b, c):
    if (a%c)==0:
        return (b//c)-(a//c)+1
    else:
        return (b//c)-(a//c)
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
XC = div_num(A, B, C)
XD = div_num(A, B, D)
print("XC==={},  XD==={},  XCD==={}".format(XC,XD,XCD))
print(B-A+1-(XC+XD-XCD))

### FIXED CODE ###

A, B, C, D = map(int, input().split())
def div_num(a, b, c):
    if (a%c)==0:
        return (b//c)-(a//c)+1
    else:
        return (b//c)-(a//c)
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
XC = div_num(A, B, C)
XD = div_num(A, B, D)
XCD = div_num(A,B,int((C*D)/gcd(C,D)))
print(B-A+1-(XC+XD-XCD))
h,w = map(int,input().split())
a = [list(input()) for nesya in range(h)]
b = [['.']*w for motsu in range(h)]
b[0][0] = '#'
j = 0
for i in range(h):
  while a[i][j+1] == '#':
    j += 1
    b[i][j] = '#'
  b[i+1][j] = '#'
if a == b:
  print('Possible')
else:
  print('Impossible')

### FIXED CODE ###

h,w = map(int,input().split())
a = [list(input()) for nesya in range(h)]
c = 0
for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      c += 1

if c == h+w-1:
  print('Possible')
else:
  print('Impossible')
def prob(n):
    n = str(n)
    sn = 0
    for i in n:
        sn += int(i)
    n = int(n)
    print('Yes') if not n % sn else ('No')

n = input()
prob(n)

### FIXED CODE ###

s = input()
num = 0

for i in range(len(s)):
    num = num + 1 if  s[i] == '+' else num - 1

print(num)
# https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け


x, y = map(int, input().split())
if x > 0:
    if x < y:
        print(y - x)

    elif 0 <= y:
        print(x + y + 1)
        raise ValueError()
    else:
        print(min(1 + x + y, -y - x + 1))
else:  # xが負
    if y < x:
        print(2 + x - y)
    elif y <= 0:
        print(y - x)
    else:
        print(min(y - x, 1 + y + x))


### FIXED CODE ###

# https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け


x, y = map(int, input().split())
if x * y < 0:  # 異符号ならば答えは一つ
    print(abs(abs(x) - abs(y)) + 1)
    exit()
elif 0 <= x < y:
    print(y - x)
    exit()
elif 0 < y < x:
    print(2 + x - y)
    exit()
elif y == 0 and y < x:
    print(1 + x)
    exit()
elif x < y <= 0:
    print(y - x)
    exit()
elif y < x < 0:
    print(2 + x - y)
    exit()
elif x == 0 and y < x:
    print(1 - y)
    exit()
raise ValueError()