John Doe is a famous DJ and, therefore, has the problem of optimizing the placement of songs on his tapes. For a given tape and for each song on that tape John knows the length of the song and the frequency of playing that song. His problem is to record the songs on the tape in an order that minimizes the expected access time. If the songs are recorded in the order S
(s1), ..., S
s(n) on the tape then the function that must be minimized is
n s(i)
∑fs(i)∑ls(j)
i=1 j=1
where f
s(i) is the frequency of playing the i
th song and l is the length of the song. Can you help John?