Problem F. ACboy needs your help
时间限制 1000 ms
内存限制 32 MB
ACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different course depending on the days he spend on it.How to arrange the M days for the N courses to maximize the profit?
输入数据
输出数据
For each data set, your program should output a line which contains the number of the max profit ACboy will gain.
样例输入
复制
2 2
1 2
1 3
2 2
2 1
2 1
2 3
3 2 1
3 2 1
0 0
样例输出
$ Mathjax font initiator $