#P7201. Džumbus Distribution
Džumbus Distribution
Džumbus Distribution
Marin prepares a different unit amount of džumbus for each banquet. He has a group of friends, each of whom requires a minimum amount of džumbus in order to share his answer. In each banquet, Marin can offer the prepared džumbus to at most one friend. A friend will share Marin’s answer if and only if the amount offered is greater than or equal to his personal threshold requirement, and each friend can receive at most one offer.
Your task is to determine the maximum number of friends who can share Marin’s answer.
Note: The amounts of džumbus prepared for each banquet are distinct.
inputFormat
The first line of input contains two integers m and n, where m is the number of friends and n is the number of banquets.
The second line contains m integers: b1, b2, ..., bm, where bi is the minimum amount of džumbus required by the i-th friend.
The third line contains n distinct integers: a1, a2, ..., an, where ai is the amount of džumbus prepared for the i-th banquet.
outputFormat
Output a single integer representing the maximum number of friends who can share Marin’s answer.
sample
3 4
3 1 2
1 2 3 4
3