<gouthampradhan>dynamic_programming_MinimumNumberOfRefuelingStops_1.java
public int minRefuelStops(int target, int startFuel, int[][] stations) {
    long[] dp = new long[stations.length + 1];
    dp[0] = startFuel;
    for (int i = 0; i < stations.length; i++) {
      int d = stations[i][0];
      int f = stations[i][1];
      for (int j = i; j >= 0; j--) {
        if (dp[j] >= d) {
          dp[j + 1] = Math.max(dp[j + 1], dp[j] + f);
        }
      }
    }
    for (int i = 0; i < dp.length; i++) {
      if (dp[i] >= target) {
        return i;
      }
    }
    return -1;
  }
public int sample_funcname ( int var_0 , int var_1 , int [ ] [ ] var_2 ) {
  long [ ] var_5 = new long [ var_2 . length + 1 ] ;
  var_5 [ 0 ] = var_1 ;
  for ( int var_7 = 0 ;
  var_7 < var_2 . length ;
  var_7 ++ ) {
    int var_8 = var_2 [ var_7 ] [ 0 ] ;
    int var_9 = var_2 [ var_7 ] [ 1 ] ;
    for ( int var_10 = var_7 ;
    var_10 >= 0 ;
    var_10 -- ) {
      if ( var_5 [ var_10 ] >= var_8 ) {
        var_5 [ var_10 + 1 ] = Math . max ( var_5 [ var_10 + 1 ] , var_5 [ var_10 ] + var_9 ) ;
      }
    }
  }
  for ( int var_7 = 0 ;
  var_7 < var_5 . length ;
  var_7 ++ ) {
    if ( var_5 [ var_7 ] >= var_0 ) {
      return var_7 ;
    }
  }
  return - 1 ;
}
