comefrom: <awangdev>Copy Books_1.java
code: public int copyBooks(int[] pages, int K) {
          if (pages == null || pages.length == 0) {
              return 0;
          }
  
          int n = pages.length;
          if (K > n) {
              K = n;
          }
          int[][] dp = new int[n + 1][K + 1];
  
          dp[0][0] = 0; 
          for (int i = 1; i <= n; i++) {
              dp[i][0] = Integer.MAX_VALUE;
          }
          
          for (int i = 1; i <= n; i++) {
              for (int k = 1; k <= K; k++) { 
                  int sum = 0;
                  dp[i][k] = Integer.MAX_VALUE;
                  for (int j = i; j >= 0; j--) { 
                      dp[i][k] = Math.min(dp[i][k], Math.max(dp[j][k - 1], sum));
                      if (j > 0) {
                          sum += pages[j - 1];
                      }
                  }
              }
          }
  
          return dp[n][K];
      }
masked: public int sample_funcname ( int [ ] var_0 , int var_1 ) {
    if ( var_0 == null || var_0 . length == 0 ) {
      return 0 ;
    }
    int var_5 = var_0 . length ;
    if ( var_1 > var_5 ) {
      var_1 = var_5 ;
    }
    int [ ] [ ] var_7 = new int [ var_5 + 1 ] [ var_1 + 1 ] ;
    var_7 [ 0 ] [ 0 ] = 0 ;
    for ( int var_8 = 1 ;
    var_8 <= var_5 ;
    var_8 ++ ) {
      var_7 [ var_8 ] [ 0 ] = Integer . MAX_VALUE ;
    }
    for ( int var_8 = 1 ;
    var_8 <= var_5 ;
    var_8 ++ ) {
      for ( int var_11 = 1 ;
      var_11 <= var_1 ;
      var_11 ++ ) {
        int var_12 = 0 ;
        var_7 [ var_8 ] [ var_11 ] = Integer . MAX_VALUE ;
        for ( int var_13 = var_8 ;
        var_13 >= 0 ;
        var_13 -- ) {
          var_7 [ var_8 ] [ var_11 ] = Math . min ( var_7 [ var_8 ] [ var_11 ] , Math . max ( var_7 [ var_13 ] [ var_11 - 1 ] , var_12 ) ) ;
          if ( var_13 > 0 ) {
            var_12 += var_0 [ var_13 - 1 ] ;
          }
        }
      }
    }
    return var_7 [ var_5 ] [ var_1 ] ;
  }
  