Submit | All submissions | Best solutions | Back to list |
EIUGIFT1 - Gift Wrapping |
On Christmas, Beo will wrap gifts beautifully for the children. Beo buys n cube gifts, the i-th gift is the size of ai (1<= i <= n ) and m sheets of wrapping paper where the jth sheet is the size of bj (1 <= j <= m ). Know that wrapping paper needs to be 2 to 3 times larger than the gift.
Ask that with the number of gifts and wrapping paper given, what is the maximum number of gifts that Beo can wrap.
Input
The first line consists of 2 integers n, m () – the number of gifts and the number of gift wrapping paper.
The second line contains n integers ai (1<= i <= n ) – the size of gifts.
The third line contains m integers bi (1 <= j <= m) – the size of the wrapping papers
Output
The maximum number of gifts that Beo can wrap
Example
Input:4 44 4 2 3 2 4 5 10 15 20
Output: 2
Added by: | Ha Minh Ngoc |
Date: | 2015-01-14 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYTHON3 RUBY SQLITE SWIFT VB.NET |