#P8837. [传智杯 #3 决赛] 商店
[传智杯 #3 决赛] 商店
Description
There are students going shopping. The shop has items. The -th person has units of money, and the -th item costs yuan.
Each person can buy at most one item, and each item can be bought at most once. Find the maximum number of people who can buy an item.
Constraints: for all testdata, , .
Input Format
The input has lines in total.
Line contains two positive integers .
Line contains integers , where is the amount of money of the -th person.
Line contains integers , where is the price of the -th item.
Output Format
Output one integer, the maximum number of people who can buy an item.
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
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号