<awangdev>Backpack III_5.java
public int backPackIII(int[] A, int[] V, int m) {
        if (A == null || V == null || A.length != V.length) {
            return 0;
        }
        int n = A.length;
        int[][] dp = new int[n + 1][m + 1]; 
        for (int j = 0; j <= m; j++) {
            dp[0][j] = -1; 
        }
        dp[0][0] = 0;
        
        for (int i = 1; i <= n; i++) {
            for (int j = 0; j <= m; j++) { 
                dp[i][j] = dp[i - 1][j];
                if (j - A[i - 1] >= 0) {
                    dp[i][j] = Math.max(dp[i][j], dp[i][j - A[i - 1]] + V[i - 1]);
                }
            }
        }
        int rst = 0;
        for (int j = 0; j <= m; j++) {
            rst = Math.max(rst, dp[n][j]);
        }
        return rst;
    }
public int sample_funcname ( int [ ] var_0 , int [ ] var_1 , int var_2 ) {
  if ( var_0 == null || var_1 == null || var_0 . length != var_1 . length ) {
    return 0 ;
  }
  int var_6 = var_0 . length ;
  int [ ] [ ] var_8 = new int [ var_6 + 1 ] [ var_2 + 1 ] ;
  for ( int var_9 = 0 ;
  var_9 <= var_2 ;
  var_9 ++ ) {
    var_8 [ 0 ] [ var_9 ] = - 1 ;
  }
  var_8 [ 0 ] [ 0 ] = 0 ;
  for ( int var_10 = 1 ;
  var_10 <= var_6 ;
  var_10 ++ ) {
    for ( int var_9 = 0 ;
    var_9 <= var_2 ;
    var_9 ++ ) {
      var_8 [ var_10 ] [ var_9 ] = var_8 [ var_10 - 1 ] [ var_9 ] ;
      if ( var_9 - var_0 [ var_10 - 1 ] >= 0 ) {
        var_8 [ var_10 ] [ var_9 ] = Math . max ( var_8 [ var_10 ] [ var_9 ] , var_8 [ var_10 ] [ var_9 - var_0 [ var_10 - 1 ] ] + var_1 [ var_10 - 1 ] ) ;
      }
    }
  }
  int var_13 = 0 ;
  for ( int var_9 = 0 ;
  var_9 <= var_2 ;
  var_9 ++ ) {
    var_13 = Math . max ( var_13 , var_8 [ var_6 ] [ var_9 ] ) ;
  }
  return var_13 ;
}
