## DMPG '15 B5 - Lux-urious S'mores

View as PDF

Points: 5 (partial)
Time limit: 0.6s
Memory limit: 64M

Author:
Problem type

After beating his friends at their card game, Bob decides to make a few s'mores before retiring for the night. Bob loves s'mores, so he decides to build campfires arranged neatly in a circle to roast his s'mores quickly. Unfortunately, he does not know how efficient each of the fires are, and it is here that he requires your help.

Each campfire burns with a certain intensity . The variance of a campfire is the larger of the absolute values of the difference in intensity between itself and either of the two adjacent fires, calculated as .

Little does he know that campfires must fulfill exactly one of two conditions to be able to cook s'mores as efficiently as possible.

• — its intensity should be at least degrees, otherwise the s'mores will not melt fast enough.
• — its variance should be at most degrees, since similar fires will cook the s'mores evenly.

#### Input Specification

The input begins with three space-separated integers on one line ; , , representing the number of campfires Bob absentmindedly built, the minimum recommended intensity, and the maximum recommended variance respectively.

The next lines will each contain a single integer , denoting the intensity of the campfire, in the order in which Bob has arranged them.

#### Output Specification

Output a single integer, denoting the number of campfires Bob has built that can be used to cook s'mores efficiently.

#### Sample Input

3 2 1
1
2
1

#### Sample Output

2