Algorithm for searching using multiple fields which match a sum

I need your help for solving the following problem:

Each question can have marks(1,2..9) and duration(10,20,..60).

Now task is to create a set of questions with total marks 20 and duration 40. for eg. we can select following tuples (marks, duration) which satisfy above condition. (5,10), (5,10), (2,5), (2,5), (4,10)

We dont need to find exact match.

Can you please suggest an algorithm for this.

Comments (0)