Unable to pass any test case for the problem Deepak and his Journey

I am unabvle to pass any test case for the above mentioned problem, even though I think my logic is correct.
I am keeping a track of min cost of petrol I have witnessed so far and them purchasing the required amount of pretrol from there. Still all the test cases give a wrong answer. Please help

My code : https://ide.codingblocks.com/s/424831

Now it’s working https://ide.codingblocks.com/s/425007

Sorry but I am unable to understand you code.

Oh somehow the link content got changed, please see this https://ide.codingblocks.com/s/426245

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.