Deepak and his journey

sir in this question of Deepak and his journey my all test cases are showing wrong , I am unable to find my mistake plzz help me out?? link of my solution:https://ide.codingblocks.com/s/139163

@khushi91200 hey khushi I am extremely sorry for the delay
I am suggesting you a simple approach
1 take input n
2 make three vectors C(n),L(n),M(i)
the return type of vectors is long long
3 apply a loop from i=0 to n-1
take input for the first vectors
i.e cin>>C[i];
4 In this loop a conditional statement required
if(i==0)
M[i]=C[i];
else
M[i]=min(M[i-1],C[i]);
end of loop
5 apply a loop from i=0 to n-1
take input for the third vector L[i];
end of loop
6 take two variable
petrol_available=0
final_cost=0
7 Again apply a loop from i=0 to n-1
final_cost+=L[i]*M[i];
end of loop
8 print final_cost

but what is wrong in my approach i have used array instead of vector