a car travel start position destination target mile east start positionthere gas station way the gas station represent array station stationsi positioni fueli indicate ith gas station positioni mile east start position fueli liter gasThe car start infinite tank gas initially startfuel liter fuel it use liter gas mile drive when car reach gas station stop refuel transfer gas station carreturn minimum number refueling stop car order reach destination if reach destination return 1note car reach gas station 0 fuel leave car refuel if car reach destination 0 fuel leave consider arrive Example 1input target 1 startFuel 1 station output 0explanation we reach target refuelingexample 2input target 100 startFuel 1 station 10100output 1explanation we reach target gas stationExample 3input target 100 startFuel 10 station 1060203030306040output 2explanation we start 10 liter fuelWe drive position 10 expend 10 liter fuel we refuel 0 liter 60 liter gasthen drive position 10 position 60 expend 50 liter fueland refuel 10 liter 50 liter gas we drive reach targetWe 2 refueling stop way return 2 Constraints1 target startFuel 1090 stationslength 5001 positioni positioni1 target1 fueli 109