Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

n,m,k = map(int, input().split())
a = [0]+list(map(int, input().split()))
b = [0]+list(map(int, input().split()))

Goukei_a=[a[0]]
for i in range(1,n+1):
    Goukei_a.append(Goukei_a[i-1]+a[i])

Goukei_b=[b[0]]
for i in range(1,m+1):
    Goukei_b.append(Goukei_b[i-1]+b[i])

goukei=0
kaisuu=0
ans=0

for i in range(0,n+1):
    if Goukei_a[i]>k:
        break
    for j in range(0,m+1):
        if Goukei_b[j]>k:
            break
        goukei=Goukei_a[i]+Goukei_b[j]
        if goukei<=k:
            ans=max(ans,i+j)
        else:
            break
    
print(ans)

### FIXED CODE ###

n,m,k = map(int, input().split())

a = [0]+list(map(int, input().split()))
b = [0]+list(map(int, input().split()))

for i in range(1,n+1):
    a[i]+=a[i-1]
for i in range(1,m+1):
    b[i]+=b[i-1]

b_cnt=m
ans=0

for a_cnt in range(n+1):
    if a[a_cnt]>k:
        break
    while a[a_cnt]+b[b_cnt]>k:
         b_cnt-=1
    ans=max(ans,a_cnt+b_cnt)

print(ans)
### BUGGY CODE ###

N=input()
M=int(N)
f=1
while 2<=M:
  if M<2:M=1
  f *= M
  M -= 2
B=str(f)
A=len(B)-len(B.rstrip('0'))
print(A)

### FIXED CODE ###

n=int(input())

if n%2!=0:
  print(0)
else:
  A=0
  m=10
  while n//m>0:
    A+=n//m
    m*=5
  print(A)
### BUGGY CODE ###

n = int(input())
cnt = 0;

for i in range(n):
  cnt += i

print(cnt)

### FIXED CODE ###

n = int(input())
 
if(n % 2 == 0):
  print(int(n / 2) * (n - 1))
else:
  print(int((n-1) / 2) * n)
### BUGGY CODE ###

a = input()
a = int(a)
b = input()
b= b.rstrip().split(" ")

#print(b)
for j in range(len(b)):
    b1=[]
    for i in range(len(b)):
        if j ==i:
            i +=1
        else:
            b1.append(int(b[i]))
            i +=1
    b1 = sorted(b1)
    print(b1[int(a/2)-1])

### FIXED CODE ###

a = input()
a = int(a)
b = input()
b= b.rstrip().split(" ")

bi =[]
for i in range(len(b)):
    bi.append(int(b[i]))
    i+=1
    
#print(bi)
bs =sorted(bi)
#print(bs)
for j in range(int(a)):
    if bi[j]>=bs[int(len(bs)/2)]:
        print(bs[int(len(bs)/2-1)])
        j+=1
    else:
        print(bs[int(len(bs)/2)])
        j+=1
### BUGGY CODE ###

n = int(input())
A = sorted(list(map(int, input().split())))
amax =max(A)
amin =min(A)
cntm = A.count(amin - 1)
cntz = A.count(amin)
cntp = A.count(amin + 1)
ans = cntm + cntz + cntp
for i in A:
    cntm = cntz
    cntz = cntp
    cntp = A.count(i + 1)
    ans = max(ans,cntm + cntz + cntp)
print(ans)

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
lst =[0] * (10 ** 5 +10)
for i in A:
    if i > 0:
        lst[i - 1] += 1
    lst[i] += 1
    lst[i + 1] += 1
print(max(lst))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)

def input():
  return sys.stdin.readline()[:-1]

N, Q=map(int, input().split())

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

px=[list(map(int, input().split())) for i in range(Q)]

counter=[0]*(N+1)
for i in range(Q):
  counter[px[i][0]]+=px[i][1]
  
def f(num, prenum=-1, p=0):
  counter[num]+=p
  for postnum in link[num]:
    if postnum==prenum:
      continue
    f(postnum, num, counter[num])
    
f(1)

print(*counter[1:])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

def input():
  return sys.stdin.readline()[:-1]

N, Q=map(int, input().split())

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

px=[list(map(int, input().split())) for i in range(Q)]

counter=[0]*(N+1)
for i in range(Q):
  counter[px[i][0]]+=px[i][1]
  
def f(num, prenum=-1, p=0):
  counter[num]+=p
  for postnum in link[num]:
    if postnum==prenum:
      continue
    f(postnum, num, counter[num])
    
f(1)

print(*counter[1:])
### BUGGY CODE ###

n=int(input())
p=1
for i in range(1, n+1):
    p*=i

print(p%(10**9+7))

### FIXED CODE ###

n = int(input())
p = 1
q = 10**9+7
for i in range(1, n+1):
    p = (p*i) % q

print(p)
### BUGGY CODE ###

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

for i in range(1, N+1):
    print(A.count(i))


### FIXED CODE ###

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

C = Counter(A)


for i in range(1, N + 1):
    if i in C.keys():
        print(C[i])
    else:
        print(0)
### BUGGY CODE ###

import itertools
N = int(input())
A = list(map(int, input().split()))

S = list(itertools.combinations(A,2))
ans = 0
for s in S:
    ans += s[0]*s[1]
    
print(ans%((10**9)+7))

### FIXED CODE ###

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

ans = 0
s = sum(A)
for i in range(N-1):
    s -= A[i]
    ans += A[i]*s
    
print(ans%((10**9)+7))
### BUGGY CODE ###

R, G, B, N = map(int, input().split())
counter = 0
r = 0
while r * R <= N:
  g = 0
  while g * G <= N:
    b = (N - r*R - g*G)/B 
    if b >= 0 and b == int(b):
      counter += 1
    g += 1
  r += 1
print(counter)

### FIXED CODE ###

R, G, B, N = map(int, input().split())
counter = 0
if R < G:
  R, G = G, R
if G < B:
  G, B = B, G
if R < G:
  R, G = G, R
r = 0
while r * R <= N:
  g = 0
  if B == 1:
    counter += (N - r*R)//G + 1
    r += 1
    continue
  while g * G <= N:
    b = (N - r*R - g*G)/B 
    if b < 0:
      break
    elif b == int(b):
      counter += 1
    g += 1
  r += 1
print(counter)
### BUGGY CODE ###

N = int(input())
k = []
for i in range(N):
  A = input()
  if A in k:
    k.remove(A)
  else:
    k.append(A)
print(len(k))


### FIXED CODE ###

import collections
N = int(input())
ans = 0
now = 0
k = []
for i in range(N):
  A = int(input())
  k.append(A)
p = collections.Counter(k)
for i in p:
  if p[i]%2 == 1:
    ans += 1
print(ans)
### BUGGY CODE ###

n, q = map(int, input().split())
s = str(input())
a = []
b = []
for i in range(q):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

ss = []
ll = []
for i in range(q):
    c = s[a[i]-1:b[i]]
    d = c.count('AC')
    print(d)

### FIXED CODE ###

n, q = map(int, input().split())
s = str(input())
d = [list(map(int, input().split())) for i in range(q)]
a = [0,0]
cnt = 0
for i in range(1, n):
    if s[i-1]+s[i] == 'AC':
        cnt += 1
    a.append(cnt)

for i in range(q):
    print(a[d[i][1]]-a[d[i][0]])
### BUGGY CODE ###

import sys

sys.setrecursionlimit(2*10**5)

n, q = map(int, input().split())
graph = {i: [] for i in range(n+1)}
for _ in range(n-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)
ans = [0] * (n+1)
for _ in range(q):
    p, x = map(int, input().split())
    ans[p] += x

def dfs(now, parent):
    if parent != 0:
        ans[now] += ans[parent]
    for i in graph[now]:
        if i != parent:
            dfs(i, now)

dfs(1, 0)
print(' '.join(map(str, ans[1:])))


### FIXED CODE ###

import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n, q = map(int, input().split())
graph = {i: [] for i in range(n)}
for a, b in [[int(i)-1 for i in input().split()] for _ in range(n-1)]:
    graph[a].append(b)
    graph[b].append(a)
ans = [0] * n
for p, x in [[int(i) for i in input().split()] for _ in range(q)]:
    ans[p-1] += x

def dfs(now, parent):
    if parent != -1:
        ans[now] += ans[parent]
    for i in graph[now]:
        if i == parent:
            continue
        dfs(i, now)

dfs(0, -1)
print(' '.join(map(str, ans)))
### BUGGY CODE ###


import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# A = [ int(input()) for _ in range(N) ]
##############################

"""
基本
・max(A)以上の(B)を全部投げちゃう
・max(A)をひたすら振って、残りHP <= B の時点で投げて終わり

ただし、どれを残すべきかは確定しないので全探索
"""

N, H = map(int, input().split())
A = []
B = []
max_a = 0
max_a_b = 0
max_a_i = 0
for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

#    if max_a < a:
#        max_a = a
#        max_a_b = b
#        max_a_i = i


def get_count(N, H, max_a, max_a_b, max_a_i):
    count = 0
    for i in range(N):
        # 残すやつは何もしない
        if i == max_a_i:
            continue

        # 投げる
        if B[i] >= max_a:
            H -= B[i]
            count += 1

    # 近いところまでまとめて引く
    x = ((H-max_a_b) // max_a) - 1
    H -= (max_a * x)
    count += x

    while H > 0:
        if H <= max_a_b:
            # 投げて終わり
            count += 1
            break

        H -= max_a
        count += 1

    return count

ans = INF
for i in range(N):
    count = get_count(N, H, A[i], B[i], i)
    if count < ans:
        ans = count

print(ans)


### FIXED CODE ###


import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# A = [ int(input()) for _ in range(N) ]
##############################

N, H = map(int, input().split())
A = []
B = []

for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

max_a = max(A)

t = B[:]
t.sort(reverse=True)

count = 0
for i in range(N):
    # 先に投げても後で投げても同じなので、最初に全部投げちゃう
    # ただし強いものから投げないと、投げ終わる前に倒すケースで引っかかる
    if t[i] >= max_a:
        H -= t[i]
        count += 1

    if H <= 0:
        print(count)
        exit()


# 近いところまでまとめて引く
x = (H // max_a) - 1
H -= (max_a * x)
count += x

while H > 0:
    H -= max_a
    count += 1


print(count)
### BUGGY CODE ###

n = int(input())
values = [int(input()) for i in range(n)]
result = [max(values[0:x]+values[x+1:]) for x in range(n)]
for val in result:
    print(val)

### FIXED CODE ###

n = int(input())
values = [int(input()) for i in range(n)]
all_max = max(values)
count = 0

max_count = 0
is_include_two_max = False
for val in values:
    if val == all_max:
        max_count += 1
    if max_count == 2:
        is_include_two_max = True
        break

if is_include_two_max:
    print('\n'.join([str(all_max) for i in range(n)]))
else:
    for i, val in enumerate(values):
        if val != all_max:
            print(all_max)
        else:
            print(max(values[0:i] + values[i+1:]))
### BUGGY CODE ###

from operator import itemgetter
from bisect import bisect_left, bisect_right
import sys

def main():
    n = int(sys.stdin.readline())
    keys = map(lambda i:map(int,sys.stdin.readline().split())+[i],xrange(n))
    keys.sort()

    q = int(sys.stdin.readline())
    for i in xrange(q):
        x0,x1,y0,y1 = map(int,sys.stdin.readline().split())
        key_x,key_y,ids = zip(*keys)
        interval = xrange(bisect_left(key_x,x0),bisect_right(key_x,x1))
        if interval:
            key1 = zip(key_y,ids)
            key1 = map(lambda j:key1[j],interval)
            key1.sort()
            key_y,ids = zip(*key1)
            interval = xrange(bisect_left(key_y,y0),bisect_right(key_y,y1))
            if interval:
                ids = map(lambda j:ids[j],interval)
                ids.sort()
                map(lambda x: sys.stdout.write("{}\n".format(x)),ids)
        print ("")

if __name__ == "__main__":
    main()

### FIXED CODE ###

from sys import stdin,stdout
import math
from operator import itemgetter
from bisect import bisect_left, bisect_right
readline = stdin.readline
 
def main():
    n = int(input())
    keys = map(lambda i: map(int,readline().split())+[i], xrange(n))
    keys.sort()

    root = int(math.sqrt(len(keys)))
 
    low = [x for x, y, i in keys[::root]]
    high = [x for x, y, i in keys[root - 1::root]] + [float('inf')]
 
    keys = [sorted(keys[i:i+root], key=itemgetter(1)) for i in range(0,len(keys),root)]
    keys_y = map(lambda k:[y for x,y,i in k], keys)

    q = int(input())
    for i in xrange(q):
        sx,tx,sy,ty = map(int,readline().split())
        
        nums = []
        for i in range(bisect_left(high, sx), bisect_right(low, tx)):
            y = keys_y[i]
            for j in range(bisect_left(y, sy), bisect_right(y, ty)):
                if sx <= keys[i][j][0] <= tx:
                    nums.append(keys[i][j][2])
        if nums:
            nums.sort()
            map(lambda n:stdout.write("{}\n".format(n)), nums)
        print("")

if __name__ == "__main__":
    main()
### BUGGY CODE ###

s = str(input())
f = True
q = int(input())
for i in range(q):
    q = list(map(str, input().split()))
    if int(q[0]) == 1:
        if f:
            f = False
        else:
            f = True
    else:
        f_i = int(q[1])
        if f_i == 1:
            if f:
                s = q[2] + s
            else:
                s = s + q[2]
        else:
            if f:
                s = s + q[2]
            else:
                s = q[2] + s
if f:
    print(s)
else:
    print(s[::-1])

### FIXED CODE ###

from collections import deque
import sys
input = sys.stdin.readline

s = str(input().rstrip())
ans = deque(list(s))

f = True
q = int(input())
for i in range(q):
    q = list(map(str, input().split()))
    if int(q[0]) == 1:
        if f:
            f = False
        else:
            f = True
    else:
        f_i = int(q[1])
        if f_i == 1:
            if f:
                ans.appendleft(q[2])
            else:
                ans.append(q[2])
        else:
            if f:
                ans.append(q[2])
            else:
                ans.appendleft(q[2])
ans = list(ans)
if f:
    print("".join(ans))
else:
    print("".join(ans[::-1]))
### BUGGY CODE ###

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

hats = A[:]
import copy
from collections import defaultdict
d = defaultdict(lambda: 0)

for h in hats:
    d[h] += 1

h1 = hats[0]
 
def search(now1, now2, count, d):
    try: 
        now1, now2 = now2, now1^now2
        if d[now2] > 0:
            if count == N:
                return True
            else:
                d[now1] -= 1
                return search(now1, now2, count+1, d)
        else:
            return False
    except:
        return False
    

ans = False
for h2 in hats[1:]:
    if search(h1, h2, 2, copy.copy(d)):
        ans = True

if ans:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

hats = A[:]
import copy
from collections import defaultdict
d = defaultdict(lambda: 0)

for h in hats:
    d[h] += 1

def f():
    if len(d) == 3:
        xor = 0
        for key in d:
            xor ^= key
        if xor == 0:
            lsit_d = list(d.keys())
            if d[lsit_d [0]] == d[lsit_d [1]] and d[lsit_d [0]] == d[lsit_d [2]]:
                return 'Yes'
            else:
                return 'No'
        else:
            return 'No'

    if len(d) == 1:
        lsit_d = list(d.keys())
        if lsit_d [0] == 0:
            return 'Yes'
        
    if len(d) == 2:
        if d[0] * 2 == N - d[0]:
            return 'Yes'
    
    return 'No'
    
print(f())
### BUGGY CODE ###

N = int(input())
A_list = [int(item) for item in input().split()]

mini = 2020202020 * 200000

all_sum = sum(A_list)

for j in range(1,N):
    F = A_list[:j]
    F_sum = sum(F)
    B_sum = all_sum - F_sum

    delta = abs(B_sum - F_sum)
    if delta <= mini:
        mini = delta

print(mini)


### FIXED CODE ###

N = int(input())
A_list = [int(item) for item in input().split()]

all_sum = sum(A_list)

F_sum_list = [A_list[0]]

for j in range(1,N):
    F_sum_list.append(F_sum_list[-1] + A_list[j])

delta_list = [abs(all_sum - 2* i) for i in F_sum_list]

print(min(delta_list))
### BUGGY CODE ###

A, B, N = map(int,input().split())
List = [int(A*i/B)-A*int(i/B) for i in range(N+1)]
print(max(List))

### FIXED CODE ###

A, B, N = map(int,input().split())
C = min([N,B-1])
ans = int(A*C/B)
print(ans)
### BUGGY CODE ###

N = int(input())
S = input()

ans = 0

for i in range(1000):
    t = '%03d' % i
    j = 0
    for s in S:
        if s == t[j]:
            j += 1
        if j== 3:
            ans += 1
            break

print(ans)

### FIXED CODE ###

from collections import defaultdict

N = int(input())
S = input()

d = defaultdict(list)
for i, s in enumerate(S):
    d[s].append(i)
ans = 0

for i in range(1000):
    T = '%03d' % i
    j = -1
    for t in T:
        flag = True
        for k in d[t]:
            if k > j:
                flag = False
                j = k
                break
        if flag:
            break
    if not(flag):
        ans += 1

print(ans)
### BUGGY CODE ###

N = int(input())
a = input().split(" ")
b= [0 for i in range(N)]

flag = True
for i in range(N):

    if a[i] in b:
        flag = False
        break
    b[i] =a[i]


if flag:
    print("YES")

else:
    print("NO")

    
    



    

### FIXED CODE ###

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

flag = True
s =0
e =N-1
for i in range(N-1):
    if b[i] == b[i+1]:
        flag = False
        break
        



if flag:
    print("YES")

else:
    print("NO")
### BUGGY CODE ###

n,q = map(int, input().split(" "))
s = input()
lr = [list(map(int, input().split(" "))) for i in range(q)]

for l, r in lr:
  txt = s[l-1:r]
  #print(txt)
  print(txt.count("AC"))
  

### FIXED CODE ###

import bisect
n,q = map(int, input().split(" "))
s = input()
lr = [list(map(int, input().split(" "))) for i in range(q)]
a = []
for i in range(n-1):
  if s[i] +s[i+1]== 'AC':
    a.append(i+1)
for l, r in lr:
  print(bisect.bisect(a, r-1) - bisect.bisect(a, l-0.1))
### BUGGY CODE ###

#!/usr/bin/env python3
#ABC141 E

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
S = input()
ans = 0
for k in range(1,n):
    s = S[:k]
    t = S[k:]
    dp = [[0 for _ in range(n - k+1)] for _ in range(k+1)]
    for i in range(k):
        for j in range(n-k):
            if s[i] == t[j]:
                dp[i + 1][j + 1] = dp[i][j] + 1
            else:
                dp[i + 1][j + 1] = max(dp[i][j+1],dp[i+1][j])
    ans = max(ans,dp[-1][-1])
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
#ABC141 E

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
s = input()
dp = [[0]*(n+1) for _ in range(n+1)]
dp[-1][-1] = 1
for i in range(n)[::-1]:
    for j in range(n)[::-1]:
        if s[i] == s[j]:
            dp[i][j] = dp[i+1][j+1] + 1
ans = 0
for i in range(n):
    for j in range(n):
        ans = max(ans,min(i-j,dp[i][j]))
print(ans)
### BUGGY CODE ###

# 177 C
N = int(input())
A = list(map(int, input().split()))
ans = 0
mod = 10**9+7
B = []
for i in range(len(A)):
    B.append(A[i]%mod)

for i in range(len(B)-1):
    for j in range(i+1, len(B)):
        ans += B[i]*B[j]
print(ans%mod)

### FIXED CODE ###

# 177 C
N = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7

sq_sum = sum(map(lambda x: x*x, A))
sum_sq = sum(A) * sum(A)
answer = (sum_sq - sq_sum) // 2

print(answer % mod)
### BUGGY CODE ###

N,K = map(int,input().split())
XYC = [list(map(int,input().split())) for _ in [0]*N]
def f(x,y,t):
    ret = 0
    for X,Y,C in XYC:
        if (C**2)*(((x-X)**2+(y-Y)**2))<=(t**2)+1e-7: ret += 1
    return ret

def get_cross_section(x1,y1,r1,x2,y2,r2):
    d = ((x1-x2)**2+(y1-y2)**2)**0.5
    if d > (r1+r2):return []
    X = (d*d+r1*r1-r2*r2)/(2*d)
    Y = max(0,(r1*r1-X*X))**0.5
    dx = (x2-x1)/d
    dy = (y2-y1)/d
    ret = [(x1+X*dx+Y*dy,y1+X*dy-Y*dx),(x1+X*dx-Y*dy,y1+X*dy+Y*dx)]
    return ret
def check(t):
    check = []
    for i in range(N):
        x1,y1,c1 = XYC[i]
        for j in range(N):
            if i==j:
                check.append((x1,y1))
                continue
            x2,y2,c2 = XYC[j]
            tmp = get_cross_section(x1,y1,t/c1,x2,y2,t/c2)
            for tmp2 in tmp:
                check.append(tmp2)

    for tmp in check:
        if f(tmp[0],tmp[1],t) >= K:return True
    return False

l=0
r=1000000
while abs(r-l)>1e-7:
    i = (l+r)/2
    if check(i):
        r = i
    else:
        l = i
print(r)

### FIXED CODE ###

N,K = map(int,input().split())
XYC = [list(map(int,input().split())) for _ in [0]*N]
eps = 1e-7
def f(x,y,t):
    ret = 0
    for X,Y,C in XYC:
        if ((x-X)**2+(y-Y)**2)<=(t/C)**2+eps: ret += 1
    return ret

def get_cross_section(x1,y1,r1,x2,y2,r2):
    d = ((x1-x2)**2+(y1-y2)**2)**0.5
    X = (d*d+r1*r1-r2*r2)/(2*d)
    Y = max(0,(r1*r1-X*X))**0.5
    dx = (x2-x1)/d
    dy = (y2-y1)/d
    ret = [(x1+X*dx+Y*dy,y1+X*dy-Y*dx)]
    if Y>0 : ret.append((x1+X*dx-Y*dy,y1+X*dy+Y*dx))
    return ret
def check(t):
    kouho = []
    for i in range(N):
        x1,y1,c1 = XYC[i]
        kouho.append((x1,y1))
        for j in range(i+1,N):
            x2,y2,c2 = XYC[j]
            tmp = get_cross_section(x1,y1,t/c1,x2,y2,t/c2)
            for tmp2 in tmp:
                kouho.append(tmp2)
    for tmp in kouho:
        if f(tmp[0],tmp[1],t) >= K:return True
    return False

l=0
r=1000000
for _ in range(100):
    i = (l+r)/2
    if check(i):
        r = i
    else:
        l = i
print(r)
### BUGGY CODE ###

nnnnn = 1010
P = 10 ** 9 + 7

fa = [1]
for i in range(1, nnnnn):
    fa.append(fa[-1] * i % P)
fainv = [pow(fa[-1], P-2, P)]
for i in range(1, nnnnn)[::-1]:
    fainv.append(fainv[-1] * i % P)
fainv = fainv[::-1]

N, K = map(int, input().split())
A = [int(a) for a in input().split()]

def calc(k):
    return [fainv[i] * fa[N-i] * fainv[k-i] * fainv[N-k] % P if i <= k else 0 for i in range(N+1)]

def conv(a, b):
    L = [0] * (N+1)
    for i in range(N+1):
        for j in range(N+1):
            if i+j <= N: L[i+j] += a[i] * b[j]
    return [l % P for l in L]

X = [1] + [0] * N
for a in A:
    X = conv(X, calc(a))

print(X[-1] * fa[N] % P)


### FIXED CODE ###

nnnnn = 1010
P = 10 ** 9 + 7

fa = [1]
for i in range(1, nnnnn):
    fa.append(fa[-1] * i % P)
fainv = [pow(fa[-1], P-2, P)]
for i in range(1, nnnnn)[::-1]:
    fainv.append(fainv[-1] * i % P)
fainv = fainv[::-1]

N, K = map(int, input().split())
A = [int(a) for a in input().split()]

def calc(k):
    return [fainv[i] * fa[N-i] * fainv[k-i] * fainv[N-k] % P if i <= k else 0 for i in range(N+1)]

def conv(a, b):
    L = [0] * (N+1)
    for i in range(N+1):
        for j in range(N+1):
            if i+j <= N: L[i+j] += a[i] * b[j]
    return [l % P for l in L]

X = [1] + [0] * N
for a in A:
    X = conv(X, calc(a))

print(X[-1] * fa[N] % P)
### BUGGY CODE ###

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

if 1 in a:
  fibo=[1,0]
else:
  fibo=[1,1]
mod=10**9+7
for i in range(2,n+1):
  if i in a:
    f=0
  else:
    f=(fibo[-2]+fibo[-1])%mod
  fibo.append(f)

print(fibo[-1])

### FIXED CODE ###

import sys
mod = 10**9+7

def main():
    n, m = map(int, input().split(' '))
    if m > 0:
        aaa = set(map(int, sys.stdin))
    else:
        aaa = set()
 
    dp = [0] * (n+1)
    dp[0] = 1
    dp[1] = 1 if 1 not in aaa else 0
    
    for i in range(2, n+1):
        if i in aaa:
            continue
        dp[i] = (dp[i-1]+dp[i-2])%mod
 
    print(dp[n])
 
main()
### BUGGY CODE ###

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

from collections import defaultdict
dic = defaultdict(int)
for a in al:
    dic[a] += 1

l = [i for i in dic.values()]
l = sorted(l)

loop = 0
ans = 0
while True:
    if len(l) > k:
        ans += l[0]
    else:
        break
    l.pop(0)

print(ans)
    

### FIXED CODE ###

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

from collections import defaultdict
dic = defaultdict(int)
for a in al:
    dic[a] += 1

l = [i for i in dic.values()]
l = sorted(l)

a = len(l) - k

ans = 0
for i in range(max(a,0)):
    ans += l[i]

print(ans)