### Description:

It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission procedure.

Each applicant will have to provide two grades: the national entrance exam grade

• The applicants are ranked according to their final grades, and will be admitted one by one from the top of the rank list.
• If there is a tied final grade, the applicants will be ranked according to their national entrance exam grade
• Each applicant may have

If there is a tied rank, and if the corresponding applicants are applying to the same school, then that school must admit all the applicants with the same rank, even if its quota will be exceeded.

### Input Specification:

Each input file contains one test case.

Each case starts with a line containing three positive integers:

In the next line, separated by a space, there are

Then

### Output Specification:

For each test case you should output the admission results for all the graduate schools. The results of each school must occupy a line, which contains the applicants' numbers that school admits. The numbers must be in increasing order and be separated by a space. There must be no extra space at the end of each line. If no applicant is admitted by a school, you must output an empty line correspondingly.

### Sample Input:

11 6 3
2 1 2 2 2 3
100 100 0 1 2
60 60 2 3 5
100 90 0 3 4
90 100 1 2 0
90 90 5 1 3
80 90 1 0 2
80 80 0 1 2
80 80 0 1 2
80 70 1 3 2
70 80 1 2 3
100 100 0 2 4


### Sample Output:

0 10
3
5 6 7
2 8

1 4

• 模拟题

### Code:

 1 /*
2 Data: 2019-07-14 18:26:36
4 AC: 39:42
5
6 题目大意：
7 初试Ge，复试Gi，总分（Ge+Gi）/2
8 按照总分，初试，依次排名；
9 K个志愿，按照学校招生名额依次录取
10 相同排名且相同志愿的考生，无论招生名额是否已满，都要录取
11 输入：
12 第一行给出，考生数N<=4e4，学校数M<=1e2，志愿数K<=5
13 接下来一行，各学校的招生名额（0~m-1）
14 接下来N行，Ge，Gi，K个志愿
15 输出：
16 各学校的录取结果，考生号递增（0~n-1）
17 未招生则打印空行
18
19 基本思路：
20 静态存储考生信息，用考生编号替代数据项排名
21 创建学校录取信息的列表，按照排名依次录取
22 */
23
24 #include<cstdio>
25 #include<vector>
26 #include<algorithm>
27 using namespace std;
28 const int N=1e5,M=110,K=10;
29 struct node
30 {
31     int ge,gi,g;
32     int se[K];
33 }info[N];
35 vector<int> sch[M];
36
37 bool cmp(const int &a, const int &b)
38 {
39     if(info[a].g != info[b].g)
40         return info[a].g > info[b].g;
41     else
42         return info[a].ge > info[b].ge;
43 }
44
45 int main()
46 {
47 #ifdef    ONLINE_JUDGE
48 #else
49     freopen("Test.txt", "r", stdin);
50 #endif
51
52     int n,m,k;
53     scanf("%d%d%d", &n,&m,&k);
54     for(int i=0; i<m; i++)
55         scanf("%d", &quota[i]);
56     for(int i=0; i<n; i++)
57     {
59         scanf("%d%d", &info[i].ge,&info[i].gi);
60         for(int j=0; j<k; j++)
61             scanf("%d", &info[i].se[j]);
62         info[i].g = info[i].ge + info[i].gi;
63     }
65     for(int i=0; i<n; i++)
66     {
68         for(int j=0; j<k; j++)
69         {
70             int cho = info[id].se[j];
71             int len = sch[cho].size();
72             if(len < quota[cho]){
73                 sch[cho].push_back(id);
74                 break;
75             }
76             else{
77                 int stu = sch[cho][len-1];
78                 if(info[stu].g==info[id].g && info[stu].ge==info[id].ge){
79                     sch[cho].push_back(id);
80                     break;
81                 }
82             }
83         }
84     }
85     for(int i=0; i<m; i++)
86     {
87         sort(sch[i].begin(),sch[i].end());
88         for(int j=0; j<sch[i].size(); j++)
89             printf("%d%c", sch[i][j],j==sch[i].size()-1?'\n':' ');
90         if(sch[i].size() == 0)
91             printf("\n");
92     }
93
94     return 0;
95 }