시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB18313412773.410%

문제

Like any other teenager, teen cows are occasionally overtaken by fads. Sometimes it's a hula hoop or a pet rock, other times it's Counterstrike, Pokemon, Rick Astley, or tribal tattoos on their udders.

Mathematically, we know that a fad has an initial attractiveness level L (1 <= L <= 50,000). Cow i has a resistance (0 <= R_i <= 1,000,000) that tells how long she can avoid a fad before having no alternative but to participate. When a fad's attractiveness level meets or exceeds a cow's fad resistance, then the cow will want to participate in the fad.

Each cow who participates in a fad increases (through peer pressure) that fad's attractiveness by some value K (1 <= K <= 2,500).

Given a population of N (1 <= N <= 100,000) cows, determine how many will participate in a fad.

입력

  • Line 1: Three space-separated integers: N, L, and K
  • Lines 2..N+1: Line i+1 contains cow i's a single integer that is fad resistance: R_i

 

출력

  • Line 1: A single integer that is the number of cows how ultimately participate in the fad.

 

예제 입력 1

5 2 3
2
6
12
5
14

예제 출력 1

3