#include using namespace std;int n, k;pair map[101];bool check[101];int dp[101][100001];void sol(){ for(int i=1; i= map[i].first) dp[i][j] = max(dp[i-1][j], dp[i-1][j-map[i].first] + map[i].second); else dp[i][j] = dp[i-1][j]; } } cout >n>>k; for(int i=1; i>map[i].first>>map[i].second; } sol();}