CPC '19 Contest 1 P2 - Luggage
View as PDFAngie is going on vacation!
But she has too much stuff she wants to bring! She has  items, each with a height of 
. However, her suitcase is quite special, it can fit as many items in it as she wants as long as they have a height range of 
 or less. The height range is the absolute difference between the maximum height of any item in the suitcase and the minimum height of any item in the suitcase.
Being a logical person, Angie wants to fit as many items in her suitcase as she can. Can you help her figure out how many?
Constraints
For all subtasks:
Subtask 1 [10%]
Subtask 2 [15%]
Subtask 3 [75%]
Input Specification
The first line contains the space separated integers  and 
.
The second line of input contains  space separated integers 
.
Output Specification
Output the most amount of items Angie can bring in her suitcase.
Sample Input
5 3
25 9 1 6 8
Sample Output
3
Sample Explanation
She can bring items , 
, and 
 for a height range of 
.
Comments
erm actually 🤓🤓🤓 … it's "number" of items because items are countable 🤓🤓🤓
Imagine wanting to bring
 items with heights ranging from 
 to 
 on vacation 🤯