I have a set of positive numbers: ${n_1,n_2,...n_k}$ s.t. $n_1>n_2>\dots >n_k$.
I want to find an array of non-negative integers $c_1,c_2,\dots,c_k$ such that
$$n_1c_1 + n_2c_2 + \dots + n_kc_k = N $$
for some given number $N$.
I have looked into Knapsack and unbounded knapsack, but they don't explicitly look to calculate the coefficients that I'm looking for, they look to maximise the value of items. I'm not sure how to solve this. The subset sum is similar, but we need subsets of multisets here.
Also, is it possible to do this in $O(n)$ time?