题库练习 Resource Distribution
← 上一题 下一题 →

A11655 | Resource Distribution

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

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.

输入格式

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.

输出格式

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.

输入输出样例

输入 #1
6 8 16
3 5 2 9 8 7
输出 #1
Yes
3 2
1 2 6
5 4
输入 #2
4 20 32
21 11 11 12
输出 #2
Yes
1 3
1
2 3 4
输入 #3
4 11 32
5 5 16 16
输出 #3
No
输入 #4
5 12 20
7 8 4 11 9
输出 #4
No
C++ 编辑器
输入
输出