# algorithms – Assign resources that each have a certain amount of work that they can provide to tasks that require a certain amount of work

I'm trying to do a hobby automation project and I got to a roadblock. I have a certain problem that I need to solve, but I cannot think of the solution nor the name of the problem.

Let's say we have n tasks where each task requires $$x_i$$ amount of work to be done and m resources where each resource can provide $$y_j$$ job. The total amount of work required will be equal to the total amount of work that the resources can provide, i.e. $$sum_ {i = 1} ^ {n} y_i = sum_ {j = 1} ^ {m} x_j$$. For all j from 1 to m, $$y_j in left {1, 2, 6, 12, 24 right }$$ and each $$x_i = a * 1 + b * 2 + c * 6 + d * 12 + e * 24$$. I was looking for task assignment issues, but these seemed a bit exaggerated as they were concerned with optimization where I was just trying to place the right blocks in the right place so as not to have tasks that are given too few or too many resources.

My current assumption is that you can go through each task and give it the greatest available resource that does not exceed the amount of work that remains for the task to be completed. It is almost analogous to filling a pot with rocks of different sizes; the best way is to start with the biggest boulders and then descend from there, so that the smallest boulders fill the space between the largest. Am I not taking into consideration something that further complicates this problem? I'm sorry if this is obvious, but I'm an amateur programmer and I couldn't think of the name of the problem or a good set of keywords for Google. The closest I could find is the assignment of tasks so far.