#include using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} const ll INF=1'000'000'000'000'000'001; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N,K; ll P; cin>>N>>P>>K; vectorT(N); vectorB(N); for(int i=0;i>T[i]>>B[i]; vectordp(K+1,-INF); dp[0]=P; for(int i=0;idp2=dp; for(int j=0;j