## LCC '22 Contest 4 J2 - C See Sea

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

To cope with his functions mark, Shane decides to go on a shopping spree.

Shane is looking for a new apartment, so he has compiled a list of apartments from across the city, each with height . His current apartment has a height of , and he can just barely see the sea from this view.

The reason he is looking for a new apartment is for a better view of the sea, so he wants to move into an apartment where . However, Shane is somewhat impatient and is only willing to check out a maximum of apartments.

From his list, can you tell Shane the heights of the tallest apartments that can see the sea? Note there may be fewer than apartments that fulfill this requirement.

#### Input Specification

The first line of input contains three integers: , , and .

The second line of input contains integers, the heights of the apartments on Shane's list.

#### Output Specification

On one line, output the heights of the tallest buildings that can see the sea, from greatest to least. If there do not exist apartments that fulfill this requirement, output the heights of those that do.

#### Sample Input 1

6 4 8
3 6 8 12 8 8 7

#### Sample Output 1

12 8 8 8

#### Sample Input 2

8 7 10
7 2 3 4 10 44 32 6

#### Sample Output 2

44 32 10

#### Sample 2 Explanation

There are only apartments that can see the sea.