CF925B.Resource Distribution
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The first line contains three integers n , x1 , x2 ( 2≤n≤300000 , 1≤x1,x2≤109 ) — 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 c1,c2,…,cn ( 1≤ci≤109 ) — 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 k1 and k2 ( 1≤k1,k2≤n ) — the number of servers used for each of the services.
In the third line print k1 integers, the indices of the servers that will be used for the first service.
In the fourth line print k2 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
说明/提示
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.