<awangdev>k Sum_1.java
public int kSum(int[] A, int k, int target) {
        if (A == null || A.length == 0 || k <= 0) {
            return 0;
        }
        
        final int[][][] dp = new int[target + 1][A.length + 1][k + 1];
        for (int j = 0; j <= A.length; j++) {
            dp[0][j][0] = 1;
        }
        for (int i = 1; i <= target; i++) {
            for (int j = 1; j <= A.length; j++) {
                for (int m = 1; m <= j && m <= k; m++) {
                    dp[i][j][m] = dp[i][j - 1][m];
                    if (i - A[j - 1] >= 0) {
                        dp[i][j][m] += dp[i - A[j - 1]][j - 1][m - 1];
                    }
                }
            }
        }
        return dp[target][A.length][k];
    }
public int sample_funcname ( int [ ] var_0 , int var_1 , int var_2 ) {
  if ( var_0 == null || var_0 . length == 0 || var_1 <= 0 ) {
    return 0 ;
  }
  final int [ ] [ ] [ ] var_7 = new int [ var_2 + 1 ] [ var_0 . length + 1 ] [ var_1 + 1 ] ;
  for ( int var_8 = 0 ;
  var_8 <= var_0 . length ;
  var_8 ++ ) {
    var_7 [ 0 ] [ var_8 ] [ 0 ] = 1 ;
  }
  for ( int var_9 = 1 ;
  var_9 <= var_2 ;
  var_9 ++ ) {
    for ( int var_8 = 1 ;
    var_8 <= var_0 . length ;
    var_8 ++ ) {
      for ( int var_10 = 1 ;
      var_10 <= var_8 && var_10 <= var_1 ;
      var_10 ++ ) {
        var_7 [ var_9 ] [ var_8 ] [ var_10 ] = var_7 [ var_9 ] [ var_8 - 1 ] [ var_10 ] ;
        if ( var_9 - var_0 [ var_8 - 1 ] >= 0 ) {
          var_7 [ var_9 ] [ var_8 ] [ var_10 ] += var_7 [ var_9 - var_0 [ var_8 - 1 ] ] [ var_8 - 1 ] [ var_10 - 1 ] ;
        }
      }
    }
  }
  return var_7 [ var_2 ] [ var_0 . length ] [ var_1 ] ;
}
