<awangdev>Backpack_5.java
public int backPack(int m, int[] A) {
        if (A == null || A.length == 0 || m <= 0) {
            return 0;
        }
        boolean[][] dp = new boolean[A.length + 1][m + 1];
        dp[0][0] = true;

        for (int i = 1; i <= A.length; i++) {
            for (int j = 0; j <= m; j++) {
                if (j - A[i - 1] >= 0) {
                    dp[i][j] = dp[i - 1][j] || dp[i - 1][j - A[i - 1]];
                } else {
                    dp[i][j] = dp[i - 1][j];
                }      
            }
        }
        for (int j = m; j >= 0; j--) {
            if (dp[A.length][j]) {
                return j;
            }
        }
        return 0;
    }
public int sample_funcname ( int var_0 , int [ ] var_1 ) {
  if ( var_1 == null || var_1 . length == 0 || var_0 <= 0 ) {
    return 0 ;
  }
  boolean [ ] [ ] var_7 = new boolean [ var_1 . length + 1 ] [ var_0 + 1 ] ;
  var_7 [ 0 ] [ 0 ] = true ;
  for ( int var_8 = 1 ;
  var_8 <= var_1 . length ;
  var_8 ++ ) {
    for ( int var_9 = 0 ;
    var_9 <= var_0 ;
    var_9 ++ ) {
      if ( var_9 - var_1 [ var_8 - 1 ] >= 0 ) {
        var_7 [ var_8 ] [ var_9 ] = var_7 [ var_8 - 1 ] [ var_9 ] || var_7 [ var_8 - 1 ] [ var_9 - var_1 [ var_8 - 1 ] ] ;
      }
      else {
        var_7 [ var_8 ] [ var_9 ] = var_7 [ var_8 - 1 ] [ var_9 ] ;
      }
    }
  }
  for ( int var_9 = var_0 ;
  var_9 >= 0 ;
  var_9 -- ) {
    if ( var_7 [ var_1 . length ] [ var_9 ] ) {
      return var_9 ;
    }
  }
  return 0 ;
}
