Type: Default 1000ms 256MiB

商店

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

nn 名同学去逛商店,店里有 mm 个物品,第 ii 人有 wiw_i 块钱,第 ii 个物品价格 cic_i 元。

每个人至多买一个物品,每个物品只能被买一次,问最多有多少人能买到物品。

Format

Input

输入共 33 行。

11 行输入 22 个正整数 n,mn,m

22 行输入 nn 个整数 w1wnw_1\ldots w_nwiw_i 表示第 ii 人的钱。

33 行输入 mm 个整数 c1cmc_1\ldots c_mcic_i 表示第 ii 个物品的价格。

Output

一行一个整数表示答案

Samples

样例输入

15 20
4 3 9 10 7 7 5 3 6 1 8 6 6 1 5 
12 4 1 9 8 5 8 6 4 5 18 8 14 9 9 7 20 11 8 19

样例输出

10

Limitation

对于50%50\%数据,n,m1000n,m \leq 1000wi,ci109w_i,c_i\leq 10^9

对于所有数据,n,m3×105n,m \leq 3 \times 10^5wi,ci109w_i,c_i\leq 10^9

20250515周赛

Not Attended
Status
Done
Rule
IOI
Problem
6
Start at
2025-5-29 16:45
End at
2025-5-29 18:15
Duration
1.5 hour(s)
Host
Partic.
23