[USACO 2009 Ope B]O Those Fads
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

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 <= Ri <= 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: Ri

输出描述:

* 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

输出

复制
3

说明

Five cows with fad resistances 2, 6, 12, 5, and 14. Initial fad attractiveness is 2; peer pressure adds 3 for each attractiveness index for each cow that participates.
The initial attraction level of 2 brings in cow #1 (whose resistance is 2) and raises the attractiveness level to 5, thus attracting cow #4 (whose resistance is 5) and raising the attractiveness level to 8. This attracts cow #2 (resistance: 6) and raises the attractiveness level to 11. Neither cow #3 (resistance: 12) or cow #5 (resistance: 14) is sucked into the fad; a total of 3 cows particpate.