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