ACM Programming Question
<p>I'm trying to solve a programming problem to practice for a competition tomorrow, and I thought maybe this would be a good place to ask how to approach it.  The problem is the first one on this site: <a href="http://www.cs.rit.edu/~icpc/questions/2010/Oswego_2010.pdf" rel="nofollow">http://www.cs.rit.edu/~icpc/questions/2010/Oswego_2010.pdf</a></p>

<p>The FAQ on this site mentions Algorithm and data structure concepts, and Design patterns, so I guess asking how to approach this problem isn't off topic. Here is what I have so far (not much). I don't understand how to solve this.</p>

<pre><code>public class Ape
{
    public void computeOutput(int weight, int[] capacities, int[] snackLosses)
    {
        //not sure what to do
    }

    public static void main(String [] args) throws FileNotFoundException
    {
        Ape ape = new Ape();
        File file = new File(args[0]);
        Scanner in = new Scanner(file);
        int totalWeight = in.nextInt();
        int n = in.nextInt();
        int[] capacities = new int[n];
        int[] snackLosses = new int[n];

        for (int i = 0; i &lt; n; i++)
        {
            capacities[i] = in.nextInt();
            snackLosses[i] = in.nextInt();
        }

        ape.computeOutput(totalWeight, capacities, snackLosses);
    }
}
</code></pre>
