staff employees. There is a list of projects it could take on: project i needs needs[i] employees and brings in revenue[i]. Each employee can work on at most one project.
Call a plan any set of projects (possibly empty) that the studio can staff, using at most staff people in total, and whose combined revenue is at least min_revenue.
Return the number of distinct plans. The answer can be very large, so return it modulo 10⁹ + 7.staff=4, min_revenue=5, needs=[1, 3, 2], revenue=[2, 4, 3] → 2
The sets {0, 1} (4 people, revenue 6) and {0, 2} (3 people, revenue 5) work. The set {1, 2} needs 5 people and {0, 1, 2} needs 6.
staff=3, min_revenue=0, needs=[2, 2], revenue=[0, 7] → 3
The threshold is zero, so the empty plan counts too. Valid plans: empty, {0} and {1}; both projects together need 4 people.
staff=10, min_revenue=1, needs=[5, 5, 5], revenue=[1, 1, 1] → 6
staff=4, min_revenue=5, needs=[1, 3, 2], revenue=[2, 4, 3]
2
Run checks the first 3 tests in your browser. Submit checks all 116 tests on the server, hidden ones included.