#C3760. Loella's Optimal Plant Growth Days

    ID: 47223 Type: Default 1000ms 256MiB

Loella's Optimal Plant Growth Days

Loella's Optimal Plant Growth Days

Loella is taking care of a special plant that requires a fixed amount of water and a minimum number of sunlight hours on an optimal growth day. You are given three parameters:

  • \(x\): Total available water in milliliters.
  • \(m\): Amount of water (in milliliters) needed per day.
  • \(n\): Minimum number of sunlight hours required per day.

You are also given a list of integers representing the number of sunlight hours available on successive days. The plant grows optimally on a day only if the sunlight is at least \(n\) hours and there is enough water (\(\ge m\) milliliters) available. Each day when the plant grows, \(m\) milliliters of water is consumed. The process stops when there is not enough water left to meet the daily requirement.

Your task is to determine the maximum number of days that the plant can grow optimally.

Note: Make sure to read input from stdin and write output to stdout.

inputFormat

The input is given via standard input and consists of three parts:

  1. The first line contains three space-separated integers: \(x\), \(m\), and \(n\).
  2. The second line contains an integer \(d\), representing the number of days.
  3. The third line contains \(d\) space-separated integers, where the \(i\)-th integer represents the available sunlight hours on the \(i\)-th day.

outputFormat

Output a single integer representing the maximum number of days the plant can grow optimally.

## sample
10 2 3
5
4 3 2 5 1
3