CF332C.Students' Revenge

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

A student's life is fraught with complications. Some Berland University students know this only too well. Having studied for two years, they contracted strong antipathy towards the chairperson of some department. Indeed, the person in question wasn't the kindest of ladies to begin with: prone to reforming groups, banning automatic passes and other mean deeds. At last the students decided that she just can't get away with all this anymore...

The students pulled some strings on the higher levels and learned that the next University directors' meeting is going to discuss nn orders about the chairperson and accept exactly pp of them. There are two values assigned to each order: aia_{i} is the number of the chairperson's hairs that turn grey if she obeys the order and bib_{i} — the displeasement of the directors if the order isn't obeyed. The students may make the directors pass any pp orders chosen by them. The students know that the chairperson will obey exactly kk out of these pp orders. She will pick the orders to obey in the way that minimizes first, the directors' displeasement and second, the number of hairs on her head that turn grey.

The students want to choose pp orders in the way that maximizes the number of hairs on the chairperson's head that turn grey. If there are multiple ways to accept the orders, then the students are keen on maximizing the directors' displeasement with the chairperson's actions. Help them.

输入格式

The first line contains three integers nn ( 1<=n<=1051<=n<=10^{5} ), pp ( 1<=p<=n1<=p<=n ), kk ( 1<=k<=p1<=k<=p ) — the number of orders the directors are going to discuss, the number of orders to pass and the number of orders to be obeyed by the chairperson, correspondingly. Each of the following nn lines contains two integers aia_{i} and bib_{i} ( 1<=ai,bi<=1091<=a_{i},b_{i}<=10^{9} ), describing the corresponding order.

输出格式

Print in an arbitrary order pp distinct integers — the numbers of the orders to accept so that the students could carry out the revenge. The orders are indexed from 1 to nn in the order they occur in the input. If there are multiple solutions, you can print any of them.

输入输出样例

  • 输入#1

    5 3 2
    5 6
    5 8
    1 3
    4 3
    4 11
    

    输出#1

    3 1 2 
  • 输入#2

    5 3 3
    10 18
    18 17
    10 20
    20 18
    20 18
    

    输出#2

    2 4 5 

说明/提示

In the first sample one of optimal solutions is to pass orders 1, 2, 3. In this case the chairperson obeys orders number 1 and 2. She gets 10 new grey hairs in the head and the directors' displeasement will equal 3. Note that the same result can be achieved with order 4 instead of order 3.

In the second sample, the chairperson can obey all the orders, so the best strategy for the students is to pick the orders with the maximum sum of aia_{i} values. The chairperson gets 58 new gray hairs and the directors' displeasement will equal 0.

首页