You are given \(n\) boxes and the size of the \(i^{th}\) box is \(a_i\) . You can select at most \(k\) boxes and change their size to a positive integer.
Select some boxes and paint it with the Red color. These boxes must satisfy the following condition:
- There must be no \(1\leq i,\ j\leq n\) such that both \(i,\ j\) boxes are red and \(\frac{a_i}{a_j} > \frac{P}{Q}\).
Determine the maximum number of boxes that you can color in Red.
Input format
- First line: Four integers \(n,\ k ,\ P ,\ and\ Q\ (1\leq k \leq n \leq 2 * 10^5,\ 1\leq Q \leq P \leq 10^9)\)
- Second line: Sequence \(a_1,...,a_n\ (1\leq a_i \leq 10^9)\)
Output format
Print the required in a single line. The output must be an integer and display the maximum number of boxes that you can color in Red.
By changing the second girls's box to \(2\), we can color the first \(3\) boxes red.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor