Author: | И. Блинов | Time limit: | 2 sec | |
Input file: | Standard input | Memory limit: | 512 Mb | |
Output file: | Standard output |
The performer's voice is characterized by the range of notes they can sing. This range is referred to as tessitura. A song is characterized by a single number, hi — representing its pitch. If hi falls within the performer's tessitura, the song can be sung.
Paulundra is preparing for a series of c concerts.For each concert, she wants to prepare k songs that have not yet been sung from the n available ones. Initially, Paulundra can sing songs in the range from l to r. After each concert, she improves, and the range expands by d. She decides in which direction and by how much to expand the tessitura (it can be expanded in one direction or in both directions at once, but in total no more than d). Help her determine if she can allocate her efforts correctly and prepare for all concerts successfully.
The first line of input contains five integers: l, r, d, c, k. The second line contains a single integer n. The third line contains n integers representing hi.
Output "YES" if all c concerts will take place and "NO" otherwise.
1 ≤ n, k ≤ 105
1 ≤ hi, l, r, d ≤ 109
1 ≤ c ≤ 100
l,r ∈ [h1, h2, …, hn]
All hi are different.
No. | Standard input | Standard output |
---|---|---|
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|