CF1250I.Show Must Go On
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The first line contains one integer t ( 1≤t≤105 ) — the number of test cases in the input. Then the test cases follow.
Each test case begins with a line containing three integers n , k and m ( 1≤n≤106 , 1≤k≤1018 , 1≤m≤106 ) — the total number of dancers, the maximum acceptable awkwardness of a set of dancers and the maximum number of concerts, respectively.
The following line contains n integers a1,a2,…,an ( 1≤ai≤1012 ), where ai is the awkwardness of the i -th dancer.
The sum of the values of n over all test cases in the input does not exceed 106 . Similarly, the sum of the values of m over all test cases in the input does not exceed 106 .
输入格式
Print the answers to all test cases in the input.
If the troupe cannot give concerts at all, then simply print one line "0". In this case, you should not print anything else.
If the troupe gives a positive number of concerts r ( r is equal to the minimum of m and the total number of valid sets), then first print the value of r , then r lines: the j -th line should contain two integers sj and tj — the number of dancers in the j -th concert and the total awkwardness of the dancers performing in the j -th concert. Complete the output to a test case with a line that describes the last set: print exactly sr distinct integers from 1 to n — the numbers of the dancers who will perform at the r -th (last) concert, in any order. If there are several answers, print any of them.
输出格式
无
输入输出样例
输入#1
3 7 13 10 3 1 5 1 8 2 13 2 10 1 12 12 3 32 100000 2 1 5
输出#1
10 5 12 4 7 4 9 4 10 4 11 4 11 4 12 4 13 3 4 3 5 2 4 1 0 7 3 8 2 3 2 6 2 7 1 1 1 2 1 5 3