comefrom: <awangdev>Max Sum of Rectangle No Larger Than K_1.java
code: public int maxSumSubmatrix(int[][] matrix, int k) {
          if (matrix == null || matrix.length == 0 || matrix[0] == null || matrix[0].length == 0) {
              return -1;
          }
          int m = Math.min(matrix.length, matrix[0].length);
          int n = Math.max(matrix.length, matrix[0].length);
          boolean rowFirst = matrix.length < matrix[0].length;
          int max = Integer.MIN_VALUE;
          for (int row = 0; row < m; row++) {
              int[] preSum = new int[n];
              for (int i = row; i < m; i++) { 
                  TreeSet<Integer> areaSet = new TreeSet<>();
                  int newSum = 0; 
                  for (int j = 0; j < n; j++) {
                      preSum[j] += rowFirst? matrix[i][j] : matrix[j][i];
                      newSum += preSum[j];
                      if (newSum <= k) max = Math.max(max, newSum);
                      Integer extraArea = areaSet.ceiling(newSum - k);
                      if (extraArea != null) {
                          max = Math.max(max, newSum - extraArea);
                      }
                      areaSet.add(newSum);
                  }
              }
          }
          return max == Integer.MIN_VALUE ? -1 : max;
      }
masked: public int sample_funcname ( int [ ] [ ] var_0 , int var_1 ) {
    if ( var_0 == null || var_0 . length == 0 || var_0 [ 0 ] == null || var_0 [ 0 ] . length == 0 ) {
      return - 1 ;
    }
    int var_2 = Math . min ( var_0 . length , var_0 [ 0 ] . length ) ;
    int var_3 = Math . max ( var_0 . length , var_0 [ 0 ] . length ) ;
    boolean var_4 = var_0 . length < var_0 [ 0 ] . length ;
    int max = Integer . MIN_VALUE ;
    for ( int var_5 = 0 ;
    var_5 < var_2 ;
    var_5 ++ ) {
      int [ ] var_6 = new int [ var_3 ] ;
      for ( int var_7 = var_5 ;
      var_7 < var_2 ;
      var_7 ++ ) {
        TreeSet < Integer > var_8 = new TreeSet < > ( ) ;
        int var_9 = 0 ;
        for ( int var_10 = 0 ;
        var_10 < var_3 ;
        var_10 ++ ) {
          var_6 [ var_10 ] += var_4 ? var_0 [ var_7 ] [ var_10 ] : var_0 [ var_10 ] [ var_7 ] ;
          var_9 += var_6 [ var_10 ] ;
          if ( var_9 <= var_1 ) max = Math . max ( max , var_9 ) ;
          Integer var_11 = var_8 . ceiling ( var_9 - var_1 ) ;
          if ( var_11 != null ) {
            max = Math . max ( max , var_9 - var_11 ) ;
          }
          var_8 . add ( var_9 ) ;
        }
      }
    }
    return max == Integer . MIN_VALUE ? - 1 : max ;
  }
  