import std.algorithm, std.array, std.conv, std.range, std.stdio, std.string;
void main()
{
    auto buf = readln.chomp.split.to!(int[]);
    auto a = readln.chomp.split.to!(long[]).sort!((x, y) => x > y);
    solve(buf[0], buf[1], buf[2], buf[3], a).writeln;
}
long solve(S)(in int problems, in long judges, in int votes, in int contest, S scores)
{
    if (possible(scores.length-1, problems, judges, votes, contest, scores))
        return scores.length;
    size_t leftPossible = contest - 1, rightImpossible = scores.length - 1;
    while (leftPossible + 1 < rightImpossible)
    {
        immutable size_t mid = leftPossible + (rightImpossible - leftPossible) / 2;
        if (possible(mid, problems, judges, votes, contest, scores))
            leftPossible = mid;
        else
            rightImpossible = mid;
    }
    return leftPossible + 1;
}

bool possible(S)(in size_t i, in int problems, in long judges, in int votes, in int contest, S scores)
{
    long s;
    foreach (j; contest-1..i)
        s += scores[i] + judges - scores[j];
    s += (contest-1) * judges;
    s += (problems-i) * judges;
    bool ret = votes * judges <= s;
    stderr.writefln("p(%d) = %d", i, ret);
    return ret;
}
