Car refueling problem C++ code