My approach to this problem

I have given the link to my code above.
My approach is that we keep adding the reached checkpoints in a min priority queue and for every checkpoint keep adding the distance to next checkpoint * top of priority queue(lowest cost petrol)

None of my test cases are correct.

@sankalp.sharma99 your approach is okay but the input constraints are very big so change your data types accordingly. See for eg in this code all the variables are taken as long long int instead of just int and it is getting AC

yeah that seemed to be the issue. Thanks

@sankalp.sharma99 please mark the doubt as resolved if you are satisfied :slight_smile: