#include<bits/stdc++.h>
using namespace std;
int n,a,s,b,cnt;
struct node{
int x;
int y;
}ap[5005];
bool cmp(node q,node p){
if(p.x > a + b) return true;
if(q.x > a + b) return false;
return q.y < p.y;
}
signed main(){
cin.tie(0)->sync_with_stdio(0);
cin >> n >> s >> a >> b;
for(int i = 1;i <= n;++i) cin >> ap[i].x >> ap[i].y;
sort(ap + 1,ap + n + 1,cmp);
for(int i = 1;i <= n;++i){
if(s < ap[i].y) break;
s -= ap[i].y;
cnt++;
}
cout << cnt << endl;
return 0;
}
我只想知道我错哪了,不想要代码,回复记得@我一下,谢谢