P2989 [USACO10MAR] Need For Speed S
Description
Bessie is preparing her race car for the upcoming Grand Prix, but she wants to buy some extra parts to improve the car's performance. Her race car currently has mass M (1
Input Format
\* Line 1: Three space-separated integers: F, M, and N
\* Lines 2..N+1: Line i+1 contains two space separated integers: F\_i and M\_i
Output Format
\* Lines 1..P: The index values of P extra parts, one per line, that Bessie should add to her racecar. If she should not add any, output 'NONE' (without quotes). The output should be given in increasing order, so if the optimal set of parts is {2,4,6,7}, then the output should be in the order 2,4,6,7 and not, for example, 4,2,7,6. Solutions will be unique.