include[HTML_REMOVED]
define Q 1001
define MAX(a,b) ((a)>(b)?(a):(b))
int main(){
int N,V,i,j;
scanf(“%d %d”,&N,&V);
int value[Q],weight[Q],dp[Q][Q];
for(i=0;i[HTML_REMOVED]j)
dp[i][j]=dp[i-1][j];
else
dp[i][j]=MAX(value[i-1]+dp[i-1][j-weight[i-1]],dp[i-1][j]);
}
}
printf(“%d”,dp[N][V]);
return 0;
}