VK Cup 2018 - Round 3
B
Resource Distribution
Codeforces
1700
原题
← AC →
翻译中…

One department of some software company has $n$ servers of different specifications. Servers are indexed with consecutive integers from $1$ to $n$. Suppose that the specifications of the $j$-th server may be expressed with a single integer number $c_j$ of artificial resource units.

翻译中…

In order for production to work, it is needed to deploy two services $S_1$ and $S_2$ to process incoming requests using the servers of the department. Processing of incoming requests of service $S_i$ takes $x_i$ resource units.

翻译中…

The described situation happens in an advanced company, that is why each service may be deployed using not only one server, but several servers simultaneously. If service $S_i$ is deployed using $k_i$ servers, then the load is divided equally between these servers and each server requires only $x_i / k_i$ (that may be a fractional number) resource units.

翻译中…

Each server may be left unused at all, or be used for deploying exactly one of the services (but not for two of them simultaneously). The service should not use more resources than the server provides.

翻译中…

Determine if it is possible to deploy both services using the given servers, and if yes, determine which servers should be used for deploying each of the services.

翻译中…

Input

翻译中…

The first line contains three integers $n$, $x_1$, $x_2$ ($2 \leq n \leq 300\,000$, $1 \leq x_1, x_2 \leq 10^9$) — the number of servers that the department may use, and resource units requirements for each of the services.

翻译中…

The second line contains $n$ space-separated integers $c_1, c_2, \ldots, c_n$ ($1 \leq c_i \leq 10^9$) — the number of resource units provided by each of the servers.

翻译中…

Output

翻译中…

If it is impossible to deploy both services using the given servers, print the only word "No" (without the quotes).

翻译中…

Otherwise print the word "Yes" (without the quotes).

翻译中…

In the second line print two integers $k_1$ and $k_2$ ($1 \leq k_1, k_2 \leq n$) — the number of servers used for each of the services.

翻译中…

In the third line print $k_1$ integers, the indices of the servers that will be used for the first service.

翻译中…

In the fourth line print $k_2$ integers, the indices of the servers that will be used for the second service.

翻译中…

No index may appear twice among the indices you print in the last two lines. If there are several possible answers, it is allowed to print any of them.

翻译中…

Note

翻译中…

In the first sample test each of the servers 1, 2 and 6 will will provide $8 / 3 = 2.(6)$ resource units and each of the servers 5, 4 will provide $16 / 2 = 8$ resource units.

翻译中…

In the second sample test the first server will provide $20$ resource units and each of the remaining servers will provide $32 / 3 = 10.(6)$ resource units.

翻译中…

样例

Input #1
6 8 16
3 5 2 9 8 7
Output #1
Yes
3 2
1 2 6
5 4
InputCopy OutputCopy
Input #2
4 20 32
21 11 11 12
Output #2
Yes
1 3
1
2 3 4
InputCopy OutputCopy
Input #3
4 11 32
5 5 16 16
Output #3
No
InputCopy OutputCopy
Input #4
5 12 20
7 8 4 11 9
Output #4
No
InputCopy OutputCopy
题目信息
题号
925B
时间限制
2 s
内存限制
256 MB
标签
二分
模拟
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。