Logo
(追記) (追記ここまで)

3639번 - K Best 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 64 MB236755830.688%

문제

Demy has $n$ jewels. Each of her jewels has some value $v_i$ and weight $w_i$.

Since her husband John got broke after recent financial crises, Demy has decided to sell some jewels. She has decided that she would keep $k$ best jewels for herself.

She decided to keep such jewels that their specific value is as large as possible. That is, denote the specific value of some set of jewels $S = \{i_1, i_2, \ldots, i_k\}$ as

$$s(S) = \frac{\sum\limits_{j = 1}^k{v_{i_j}}}{\sum\limits_{j = 1}^k{w_{i_j}}}.$$

Demy would like to select such $k$ jewels that their specific value is maximal possible. Help her to do so.

입력

The first line of the input file contains $n$ --- the number of jewels Demy got, and $k$ --- the number of jewels she would like to keep (1ドル \le k \le n \le 100,000円$).

The following $n$ lines contain two integer numbers each --- $v_i$ and $w_i$ (0ドル \le v_i \le 10^6,ドル 1ドル \le w_i \le 10^6,ドル both the sum of all $v_i$ and the sum of all $w_i$ do not exceed 10ドル^7$).

출력

Output $k$ numbers --- the numbers of jewels Demy must keep. If there are several solutions, output any one.

제한

예제 입력 1

3 2
1 1
1 2
1 3

예제 출력 1

1 2

힌트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > NEERC Northern Subregional 2005 K번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /