Deepak and his Journey-Greedy Algorithms

Code is at the link https://ide.codingblocks.com/s/238670. It is showing the compilation error. I could not understand where I am wrong. Pls tell me.

@ankur8632 your code is correct,but you have to use typecasting like this while calculating total_cost
total_cost+=(long long)min_cost*l[i];
since min_cost*l[i] may cross int limit.