CodeEff/ECCO huggingface dataset:
# Original solution
from collections import Counter
n,k = list(map(int,input().split()))
dic = Counter(list(map(int,input().split())))
x = len(dic) - k
lis = sorted(list(dic.items()), key = lambda z:z[1])
ans = 0
for i in range(x):
    ans += lis[i][1]
print(ans)

# Optimized solution
from collections import Counter
from operator import itemgetter
n,k = list(map(int,input().split()))
dic = Counter(list(map(int,input().split())))
x = len(dic) - k
lis = sorted(list(dic.items()), key = itemgetter(1))
ans = 0
for i in range(x):
    ans += lis[i][1]
print(ans)
# Original solution
N,K=list(map(int,input().split()))
s=list(map(int,input().split()))
t=list(set(s))
ss,ans=[],0
for i in t:
    ss.append(s.count(i))
    ss=sorted(ss)
if len(ss)>K:
    for i in range(len(ss)-K):
        ans+=ss[i]
    print(ans)      
else:
    print("0")

# Optimized solution
N,K=list(map(int,input().split()))
d,ans={},0
for i in list(map(int,input().split())):
    d[i]=d.get(i,0)+1
s=sorted(d.values())
for i in range(len(s)-K):
    ans+=s[i]
print(ans)
# Original solution
from collections import Counter
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

c = Counter(A).most_common()
c.sort(key=lambda x: -x[1])
ans = 0
while len(c) > K:
    ans += c.pop()[1]
print(ans)

# Optimized solution
from collections import Counter
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
print((sum(sorted(Counter(A).values())[:-K])))
# Original solution
from collections import Counter
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

cnt = Counter()
for num in A:
    cnt[str(num)] += 1

values = sorted(cnt.values())
ans = 0
for x in range(len(values) - K):
    ans += values.pop(0)

print(ans)

# Optimized solution
from collections import Counter
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

cnt = Counter()
for num in A:
    cnt[str(num)] += 1

values = sorted(cnt.values())
ans = sum(values[:max(len(values)-K, 0)])

print(ans)
# Original solution
from collections import Counter
N,K = [int(i) for i in input().split()] 
A = [int(i) for i in input().split()]
counter = Counter(A)
ans = 0
counter_list = counter.most_common()
if K < len(counter_list):
    while (K!=len(counter_list)):
        ans += counter_list[-1][1]
        counter_list = counter_list[:-1]

print(ans)

# Optimized solution
from collections import Counter
N,K = [int(i) for i in input().split()] 
A = [int(i) for i in input().split()]
counter = Counter(A)
ans = 0
counter_list = counter.most_common()[::-1]
if K < len(counter_list):
    for a in counter_list[:len(counter_list)-K]:
        ans += a[1]
print(ans)
# Original solution
N,K = list(map(int, input().split(' ')))
A = input().split(' ')

num = []
count = []
for a in range(len(A)):
    tmp = A[a]
    if not tmp in num:
        num.append(tmp)
        count.append(1)
    else:
        index = num.index(tmp)
        count[index] += 1

count = sorted(count)
ans = 0
if len(count)<=K:
    pass
else:
    tmp = len(count)-K
    count = count[:tmp]
    ans = sum(count)

print(ans)

# Optimized solution
#辞書型でリトライ
N,K = list(map(int, input().split(' ')))
A = input().split(' ')

dic = {}
for a in range(len(A)):
    tmp = A[a]
    if not tmp in dic:
        dic[tmp] = 1
    else:
        dic[tmp] += 1

values = sorted(dic.values())
ans = 0
if len(values)<=K:
    pass
else:
    tmp = len(values)-K
    values = values[:tmp]
    ans = sum(values)

print(ans)
# Original solution
# coding: utf-8

# https://atcoder.jp/contests/abc081/tasks/arc086_a
# 14:07-14:14 done


def main():
    N, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A = sorted(A)

    cnt = {}
    for a in A:
        if a in cnt:
            cnt[a] += 1
        else:
            cnt[a] = 1
    
    num_cnts = [[k, v] for k, v in list(cnt.items())]

    if len(num_cnts) <= K:
        return 0

    num_cnts = sorted(num_cnts, key=lambda x: x[1], reverse=True)
    ans = sum([cnt for num, cnt in num_cnts[K:]])

    return ans


print((main()))


# Optimized solution
# coding: utf-8

# https://atcoder.jp/contests/abc081/tasks/arc086_a
# 14:07-14:14 done


def main():
    N, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A = sorted(A)

    cnt = {}
    for a in A:
        if a in cnt:
            cnt[a] += 1
        else:
            cnt[a] = 1
    
    num_cnts = [[k, v] for k, v in list(cnt.items())]

    # if len(num_cnts) <= K:
    #     return 0

    num_cnts = sorted(num_cnts, key=lambda x: x[1], reverse=True)
    ans = sum([cnt for num, cnt in num_cnts[K:]])

    return ans


print((main()))
# Original solution
from collections import Counter
_, K = list(map(int, input().split()))
A = list(map(int, input().split()))
_, cnt = list(zip(*Counter(A).most_common()[::-1]))
print((sum(cnt[:len(cnt) - K])))

# Optimized solution
from collections import Counter
_, K = list(map(int, input().split()))
A = sorted(list(Counter(input().split()).values()))
print((sum(A[:len(A)-K])))
# Original solution
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

from collections import Counter

c = Counter(A)
cnt = 0

if len(c) > K:
    for i in range(K, len(c)):
        cnt += c.most_common()[i][1]
        
print(cnt)

# Optimized solution
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

from collections import Counter

ac = Counter(A)
cnt = 0

if len(ac) > K:
    for a in ac.most_common()[K:]:
        cnt += a[1]
        
print(cnt)
# Original solution
from collections import Counter
 
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))
 
c = Counter(a)
l = len(c)
cnt = 0
if k < l:
    i = -1
    for _ in range(l-k):
        cnt += c.most_common()[i][1]
        i -= 1
print(cnt)

# Optimized solution
from collections import Counter
import heapq
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))
c = Counter(a)
heapc = list(c.values())
heapq.heapify(heapc)
l = len(c)
cnt = 0
if k < l:
    for _ in range(l-k):
        cnt += heapq.heappop(heapc)
print(cnt)
# Original solution
N, K = (int(x) for x in input().split())
A = [int(x) for x in input().split()]
cnt = [A.count(a) for a in set(A)]
cnt.sort()
vrt = len(cnt)
print((sum(cnt[:vrt-K]) if vrt > K else 0))

# Optimized solution
import bisect as bs
N, K = (int(x) for x in input().split())
A = sorted([int(x) for x in input().split()])
f = lambda X, x: bs.bisect_right(X,x)-bs.bisect_left(X,x)
cnt = sorted([f(A,a) for a in set(A)],reverse=True)
vrt = len(cnt)
print((sum(cnt[K:]) if vrt > K else 0))
# Original solution
# ABC081C - Not so Diverse (ARC086C)
from collections import Counter


def main():
    N, K, *A = list(map(int, open(0).read().split()))
    C = list(Counter(A).values())
    C.sort(reverse=1)
    ans = sum(C[K:])
    print(ans)


if __name__ == "__main__":
    main()

# Optimized solution
# ABC081C - Not so Diverse (ARC086C)
from collections import Counter


def main():
    N, K, *A = open(0).read().split()
    C, K = list(Counter(A).values()), int(K)
    C.sort(reverse=1)
    ans = sum(C[K:])
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
from collections import defaultdict
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

d = defaultdict(int)
for i in range(N):
  d[A[i]] += 1
  
cnt = len(list(d.keys())) - K
d = sorted(list(d.items()), key=lambda x:x[1])
ans = 0
for val in d:
  if cnt <= 0:
    print(ans)
    exit()
  ans += val[1]
  cnt -= 1

# Optimized solution
from collections import defaultdict
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

d = defaultdict(int)
for i in range(N):
  d[A[i]] += 1
  
cnt = max(len(list(d.keys())) - K, 0)
d = sorted(list(d.items()), key=lambda x:x[1])
ans = 0
for i in range(cnt):
  ans += d[i][1]
print(ans)
# Original solution
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
dict = {}
for Ai in A:
    if Ai in dict:
        dict[Ai] += 1
    else:
        dict[Ai] = 1
count = 0
while len(dict) > K:
    max_key = max(dict, key=dict.get)
    min_key = min(dict, key=dict.get)
    dict[max_key] += 1
    dict[min_key] -= 1
    count += 1
    if dict[min_key] == 0:
        del dict[min_key]
print(count)

# Optimized solution
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
dict = {}
for Ai in A:
    if Ai in dict:
        dict[Ai] += 1
    else:
        dict[Ai] = 1
count = 0
if len(dict) > K:
    count = sum(sorted(dict.values())[:len(dict) - K])
print(count)
# Original solution
from collections import Counter
n, k = list(map(int, input().split()))
a = Counter((i for i in input().split()))

sort_count = sorted(list(a.items()), key=lambda x: x[1])

total = 0
while len(sort_count) > k:
    _, n = sort_count.pop(0)
    total += n

print(total)

# Optimized solution
N, K = list(map(int, input().split()))
B = [0]*(N+1)
for i in input().split():
  B[int(i)] += 1
print((sum(sorted(B)[:-K])))
# Original solution
from collections import Counter

n,k=list(map(int,input().split()))
a=input().split()
x=len(list(set(a)))
n=x-k if x-k>=0 else 0

counter=Counter(a)
l=sorted(counter.values())
print((sum(l[:n])))

# Optimized solution
from collections import Counter

n,k=list(map(int,input().split()))
a=input().split()
x=len(list(set(a)))
n=x-k if x-k>=0 else 0
print((sum(sorted(Counter(a).values())[:n])))
# Original solution
import sys
from collections import Counter

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    C = Counter(A)

    ans = 0
    if len(C) <= K:
        print((0))
        return
    else:
        for i in range(len(C) - K):
            ans += C.most_common()[-i - 1][1]

    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
import sys
from collections import Counter

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    C = Counter(A)

    ans = 0
    if len(C) <= K:
        print((0))
        return
    else:
        mc = C.most_common()
        for i in range(len(C) - K):
            ans += mc[-i - 1][1]

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
n,k = list(map(int,input().split()))
l = list(map(int, input().split()))
def counter(l):
    count = {}
    for i in l:
        count[i] = l.count(i)
    return sorted(count.values())

freq = counter(l)
vf = len(freq) - k if len(freq)> k else 0
print((sum(freq[:vf])))

# Optimized solution
n,k = list(map(int,input().split()))
l = list(map(int, input().split()))
freq = [0]*(n+1)
for i in l:
    freq[i]+=1
freq.sort()
vf = len(freq) - k if len(freq)> k else 0
print((sum(freq[:vf])))
# Original solution
from collections import Counter
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
cnt = Counter(a)
mo = cnt.most_common()[::-1]
#print(mo)
ans = 0
for i in range(max(0,len(mo)-k)):
    ans += mo[i][1]
print(ans)


# Optimized solution
from collections import Counter
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
cnt = Counter(a)
mo = sorted(cnt.values())
#print(mo)
ans = 0
for i in range(max(0,len(mo)-k)):
    ans += mo[i]
print(ans)
# Original solution
def main():
    from collections import Counter

    n, k, *a = list(map(int, open(0).read().split()))
    c = Counter(a)
    v = len(c)
    l = list(c.values())
    m = sorted(l)
    ans = sum(m[:v - k])
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    from collections import Counter

    n, k, *a = list(map(int, open(0).read().split()))
    c = list(Counter(a).values())
    v = len(c) - k
    l = list(c)
    l.sort()
    ans = sum(l[:v])
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
from collections import *
f=lambda:list(map(int,input().split()))
_,k=f()
c=Counter(f())
print((sum(sorted(c.values())[~k::-1])))

# Optimized solution
from collections import*;f=lambda:list(map(int,input().split()));_,k=f();print((sum(sorted(Counter(f()).values())[:-k])))
# Original solution
import collections
from collections import  OrderedDict

num = [int(x) for x in input().split()]
val = input().split()

count_dict = collections.Counter(val)

cant = 0

if len(count_dict) <= num[1]:
    print((0))
else:
    sort_dict = OrderedDict(sorted(list(count_dict.items()), key=lambda x:x[1], reverse= True))
    value_dict = list(sort_dict.values())
    print((sum(list(value_dict)[num[1]:])))

# Optimized solution
import collections

n, k = list(map(int, input().split()))
array = [int(x) for x in input().split()]
_dict = collections.Counter(array)

res = 0
tmp = len(list(_dict.values()))
if len(list(_dict.values())) < k:
    print((0))
else:
    sort_dict = collections.OrderedDict(sorted(list(_dict.items()), key=lambda x: x[1], reverse=True))
    value_dict = list(sort_dict.values())
    print((sum(list(value_dict)[k:])))
# Original solution
import collections


def calc(A, K):
    dist = {}
    tmp = collections.Counter(A)
    type_ = len(tmp)

    if type_ <= K:
        return 0

    for a, count in list(tmp.items()):
        if count not in list(dist.keys()):
            dist[count] = [a]
        else:
            dist[count].append(a)

    rewrite = 0
    i = 0
    for c in sorted(dist.keys()):
        for _ in dist[c]:
            i += 1
            rewrite += c
            if i == type_ - K:
                return rewrite


def main():
    N, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    ans = calc(A, K)
    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
N, K = list(map(int, input().split()))
cnt = [0 for _ in range(N)]

for i in map(int, input().split()):
    cnt[i-1] += 1

ans = 0
for i in sorted(cnt)[:N - K]:
    ans += i

print(ans)
# Original solution
N,K=list(map(int,input().split()))
A=list(map(int,input().split()))
As=list(set(A))
sa=max(0,len(As)-K)
if sa==0:
    print((0))
    exit
else:
    count=[0]*len(As)
    for i in range(len(As)):
        count[i]=int(A.count(As[i]))
    num=sorted(count)
    num2=num[0:sa]
    ans=0
    for i in num2:
        ans+=i
    print(ans)

# Optimized solution
N,K=list(map(int,input().split()))
A=list(map(int,input().split()))
sa=len(set(A))-K
if sa>0:
    As={}
    for i in range(N):
        if A[i] in As:
            As[A[i]]+=1
        else:
            As[A[i]]=1
    Ass=sorted(As.values())
    print((sum(Ass[:sa])))
else:
    print((0))
# Original solution

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

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

m = list(set(n))



c = 0
if len(m) <= b:
    print((0))
else:
    dic = {}
    for i in range(len(m)):
        dic[str(m[i])] = n.count(m[i])

    dic = sorted(list(dic.items()), key = lambda x:x[1])
    for i in range(len(m) - b):
        c += dic[i][1]
    print(c)


# Optimized solution
a, b = list(map(int, input().split()))

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

l = {}
for a in n:
    l[a] = l.get(a, 0) + 1
print((sum(sorted(l.values())[:-b])))
# Original solution
from collections import Counter

n, k = [int(i) for i in input().split()]
a = Counter([int(i) for i in input().split()])

cost = 0
print((sum(c for (v, c) in a.most_common()[k:])))


# Optimized solution
from collections import Counter
n, k = [int(i) for i in input().split()]
a = Counter([int(i) for i in input().split()])
print((sum(c for (v, c) in a.most_common()[k:])))
# Original solution
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = {}
for i in a:
    if i in b:
        b[i] += 1
    else:
        b[i] = 1
b = sorted(b.values())
print((sum(b[:-k])))

# Optimized solution
n, k = list(map(int, input().split()))
b = {}
for i in input().split():
    if i in b:
        b[i] += 1
    else:
        b[i] = 1
b = sorted(b.values())
print((sum(b[:-k])))
# Original solution
from collections import Counter
n,k = list(map(int, input().split()))
a = list(map(int, input().split()))

count = Counter(a)
t = len(count)
ans = 0
for i in sorted(count.values()):
  if t <= k: break
  ans += i
  t -= 1
print(ans)

# Optimized solution
from collections import Counter
n,k = list(map(int, input().split()))
a = list(map(int, input().split()))

cnt = Counter(a)

l = len(cnt)
t = l-k
ans = 0
for i in sorted(cnt.values()):
  if t <= 0: break
  t -= 1
  ans += i
print(ans)
# Original solution
import sys
# A,B,C = [int(n) for n in input().split()]
N,K = [int(n) for n in input().split()]
# S = str(input())
# T = str(input())
bucket = [0]*(N+1)
A = [int(n) for n in input().split()]
dic = {}
for a in A:
    if not(a in dic):
        dic[a]=1
    else:
        dic[a]+=1
val = sorted(dic.values())
# print(val)
rc = len(val) - K
ans = 0
for r in range(rc):
    ans += val[0]
    val = val[1:]
print((ans if ans >=0 else 0))


# Optimized solution
import sys
# A,B,C = [int(n) for n in input().split()]
N,K = [int(n) for n in input().split()]
# S = str(input())
# T = str(input())
bucket = [0]*(N+1)
A = [int(n) for n in input().split()]
dic = {}
for a in A:
    if not(a in dic):
        dic[a]=1
    else:
        dic[a]+=1
val = sorted(dic.values())
# print(val)
rc = len(val) - K
ans = 0
for r in range(rc):
    ans += val[r]
print((ans if ans >=0 else 0))
# Original solution
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))

b = [0]*200000
c = []
ans = 0

for x in a:
    b[x-1] += 1

for x in b:
    if x > 0:
        c.append(x)

c.sort()

y = len(c) - k

if y > 0:
    ans = sum(c[:y])

print(ans)

# Optimized solution
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
b = [0]*(n+1)
for x in a:
    b[x]+=1
b.sort(reverse=1)
print((sum(b[k:])))
# Original solution
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

C = list(set(A))

B = len(C)

x = B - K #種類の差

ans = 0

figure_list = [0] * B

if x<=0:
    print('0')
else:
    for i in range(B):
        stock = int(C[i])
        counter = 0
        for ii in range(N):
            if stock == A[ii]:
                counter += 1
        figure_list[i] = counter

    figure_list = sorted(figure_list)

    for i in range(B-K):
        ans += figure_list[i]

    print(ans)    





# Optimized solution

#【註】N 個のボールと K 種類の整数
N, K = list(map(int, input().split()))

#【註】ボールに書かれている数 A_1...A_N
A = list(map(int, input().split()))

#【註】何種類あるか？を set で取得
C = list(set(A))

# 数字の種類数
B = len(C) 
# 元々の種類と目的の種類の差
x = B - K

#-----
#【註】「文字：回数」という辞書を使って、ループを最小限にします。
d = {}

#【解説】A のそれぞれの要素について
for i in A:
    #【解説】もし辞書に既に登録されていれば、その値（出現回数）に 1 を足す
    if i in d:
        d[i] += 1
    #【解説】そうでなければ、辞書にキーを登録して値（出現回数）を 1 にする
    else:
        d[i] = 1

#【解説】辞書を値でソートすると、出現回数が小さい順に並ぶ
d = sorted(list(d.items()), key=lambda x:x[1])

ans = 0
count = 0

if x<=0:
    print('0')
else:
    #【解説】辞書からキーと値を取り出し
    for key, value in d:
        #【解説】取り出した玉の数に value を足す
        ans = ans + value
        #【解説】何種類取り出したか、の値に 1 を足す
        count = count + 1

        #【解説】もし x 種類取り出しが完了したら ans を出力
        if count == x:
            print(ans)
            break
# Original solution
from collections import Counter
import sys
N, K = list(map(int, input().split()))
a_lis = [int(_) for _ in input().split()]
count = 0
counter = sorted(list(Counter(a_lis).items()), key=lambda x: x[1])
while len(counter) > K:
    count += counter[0][1]
    del counter[0]
    if len(counter) == K:
        print(count)
        sys.exit()
print((0))

# Optimized solution
from collections import Counter
import sys
N, K = list(map(int, input().split()))
a_lis = [int(_) for _ in input().split()]

counter = sorted(list(Counter(a_lis).items()), key=lambda x: x[1])

if len(counter) > K:
    ans_list = counter[:len(counter) - K]
    count = sum([item[1] for item in ans_list])
    print(count)
    sys.exit()

print((0))
# Original solution
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
import collections
c = collections.Counter(A)
ans = 0
while len(c) > K:
    n = c.most_common()[-1][0]
    ans += c[n]
    del c[n]
print(ans)

# Optimized solution
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
import collections
c = collections.Counter(A)
print((N - sum([pair[1] for pair in c.most_common(K)])))
# Original solution
# _*_ coding:utf-8 _*_
#  Atcoder_Beginnger_Contest081-C
#  TODO https://atcoder.jp/contests/abc081/tasks/arc086_a
import collections as col

def solveProblem(neededBallKind,BallsList):
	AsListCounter = col.Counter(BallsList)
	allBallKind = len(AsListCounter)
	sortCounter = sorted(list(AsListCounter.items()),reverse=False,key=lambda x:x[1])
	replaceBallCount = 0
	replaceBallKind = allBallKind-neededBallKind
	if replaceBallKind <= 0:
		answer = 0
	else:
		for k,v in sortCounter:
			replaceBallCount = replaceBallCount + v
			replaceBallKind = replaceBallKind - 1
			if replaceBallKind <= 0:
				break
		answer = replaceBallCount
	return answer

if __name__ == '__main__':
	_,K = list(map(int,input().strip().split(' ')))
	AsList = list(map(int,input().strip().split(' ')))
	solution = solveProblem(K,AsList)
	print(("{}".format(solution)))


# Optimized solution
# Problem: atcoder.jp/contests/abc081/tasks/arc086_a
# Python 1st Try

import sys
# from collections import defaultdict
import collections as col
# import pprint
# import heapq,copy
# from collections import deque
def II(): return int(sys.stdin.readline())
def MI(): return list(map(int, sys.stdin.readline().split()))
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solver(ALLNUM, KIND, ball_numbers):
    result = 0
    # prp = pprint.pprint
    counter_result = col.Counter(ball_numbers)
    ball_num_len = len(counter_result)
    counter_result_sorted = sorted(list(counter_result.items()), key=lambda x: x[1])
    # prp(counter_result_sorted)
    if ball_num_len <= KIND:
        return 0
    reduce_kind = ball_num_len - KIND
    # prp(reduce_kind)
    for _, ballCount in counter_result_sorted:
        result += ballCount
        reduce_kind = reduce_kind - 1
        # prp(reduce_kind)
        if reduce_kind <= 0:
            break
    return result


if __name__ == "__main__":
    N, K = MI()
    Ai = list(map(int, sys.stdin.readline().split()))
    # print(Ai)
    print(("{}".format(solver(N, K, Ai))))