Deepak and his Journey - Greedy Algorithms

I could not understand where I am wrong in this code----Code is at the link https://ide.codingblocks.com/s/238670. It is showing that the answer is wrong.

@ankur8632 while calculating total cost use typecasting like this
total_cost+=(long long)min_cost*l[i];
since min_cost*l[i] may cross int limit.