## CPC '19 Contest 1 P2 - Luggage

View as PDF

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 128M

Author:
Problem type

Angie 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?

#### 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 .