#include <bits/stdc++.h>
using namespace std;
const int N = 50010;
typedef long long LL;
int s, d;
int a[N], b[N];
LL f[N];
int main() {
cin >> s >> d;
for (int i = 1; i <= s; i++) {
cin >> a[i] >> b[i];
for (int j = b[i]; j <= d; j++)
f[j] = max(f[j], f[j - b[i]] + a[i]);
}
int t = 0;
while (f[t] < d)
t++;
cout << t;
}
为什么5,6,10测试点会RE呢 不懂欸