小x对于到来的病人折腾得手忙脚乱:病人纷纷前来看病,但是候诊厅的容量有限。本着重症病人优先的原则,当病人排满号的时候,他每次必须将最紧急的病人送进房间。
小x想让你帮帮忙,每次排满病人的时候,自动地安排病人去看病。
第一行是两个整数n(n<20000),m(m<3000),分别表示病人个数,和候诊厅的容量。
接下来是n行,每行包含2个数,xi和i,表示i号病人到来,紧急度为xi
输出k行,每行包含一个数i,表示病人编号。
6 3 1 3 5 2 2 6 4 1 8 5 6 4
2 1 5
C:
``c
#include<stdio.h>
int main()
{
printf("**************************\n");
printf("dotcpp.com\n");
printf("**************************\n");
return 0;
}
c``
C++:
``cpp
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b)printf("%d\n",a+b);
return 0;
}
cpp``
python:
``py
while True:
try:
a,b=map(int,input().strip().split())
print(a+b)
except:
break
py``