Spamol, строка 6 >=
function cost(run, end){
var time = {0:6,3:2,15:2.5,18:3.5,21:5},
sum = 0, min = 0;
for (var i=0; i< 24; i++) {
if(i in time) min = time[i];
if(i >= run[0]) {sum += (60-run[1])*min; run[1]=0;};
if(i+1 > end[0]) {sum -= (60-end[1])*min; break;};
}
return sum;
}
alert(cost([11,3],[11,45]) );
alert((45-3)*2);