#include using namespace std; #define int long long const int INF=1001001001; templatebool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b>N; for(int i=0; i>v[i]>>w[i]; } cin>>V; dp[0][0]=0; dp[0][v[0]]=w[0]; for(int i=0; i