IBMOA #48
Max Subjects Number
估计简单可在线判题
考点(AI 标注)贪心调度
In subject i you have already answered answered[i] questions correctly, and you pass once you reach needed[i]. You can answer q more questions correctly in total; find the maximum number of subjects you can pass. Subjects already passed need no extra answers.
输入格式
The first line contains n q, the second line contains answered, and the third line contains needed. 1≤n≤100000, 0≤elements of both arrays≤10^9. On this site 0≤q≤10^14.
输出格式
Output one integer, the answer.
样例 1
输入:
3 100
24 27 0
51 52 100
输出:
2
样例 2
输入:
3 200
24 27 0
51 52 100
输出:
3
样例 3
输入:
2 0
5 0
1 1
输出:
1
样例说明
The examples give 2, 3 and 1 respectively.