Finding the minimum ratio out of many lines of input This is my code. I am having a file, whose first line's second word contains a number. Let this number is $u. 2nd line is empty, and from third line, I am given with two numbers separated by a space in each line where let first number is $c and second is $w. Now I need to figure out the minimum $b where $b for a line is ceil($u  / $w) * $c. Is there anyway I can optimize my code. 

&lt;?php
$f = file($argv[1]);
list(, $u) = explode(" ", $f[0]);
list($c, $w) = explode(" ", $f[2]);
$b = ceil($u / $w) * $c;
unset($f[0], $f[1], $f[2]);

foreach($f as $l)
{
    list($c, $w) = explode(" ", $l);
    $b = min($b, ceil($u / $w) * $c);
}

echo "$b\n";
exit;
?&gt;
I guess my comment really was an answer in a philosophical way.  So here is the answer:

Use names for your variables that have meaning.

There are lots of advantages to naming your variables well.  Many people have looked at this question only with a very abstract idea of what you are trying to do.  This makes it difficult to find improvements.  If people know exactly what you are trying to do then they can work out clever ways to achieve that.

As palacsint said: 'It won't be any slower if you use longer and readable variable names' but it may well be faster when people understand it and can see how to improve it.