Assuming there are n types of gifts, each with a number of $a_n$. Now we have to pack them into gift packs, each containing several types of gifts, and each gift has only one.If a gift package containing k types of gifts is marked as $b_k$, how to find the packaging method with the highest total score. Note that $b_k$ may not be monotonous.
For the special case where size(b)=1,I find a solution:https://www.tutorialspoint.com/program-to-find-maximum-number-of-k-sized-groups-with-distinct-type-items-are-possible-in-python, It may seem like a greedy algorithm, but I haven't provided a standardized proof of its correctness
For example, mark the four types of gifts as A B C D,a=[5,2,3,2],b=[1,3,6,0],
method:[A B C][A B C][A C D][A D][A] value:22
You can solve this variant of the cutting stock problem via integer linear programming as follows. Let $G=\{0,1,2,3\}$ be the set of gifts. Let $P=\{1,\dots,2^{|G|}-1\}$ be the set of all possible nonempty packs, with the binary representation of $p\in P$ indicating which gifts appear in pack $p$. For $g\in G$, let $P_g \subset P$ be the set of packs that contain gift $g$. Let $c_p$ denote the number of gifts in pack $p$. Let binary decision variable $x_p$ indicate whether pack $p$ is used. The problem is to maximize $$\sum_{p\in P} b_{c_p} x_p$$ subject to linear constraints $$\sum_{p\in P_g} x_p = a_g \quad \text{for all $g\in G$}$$
For your example instance, an optimal solution is $x_p=1$ for $p\in \{1,5,7,11,13\}$ and $x_p=0$ otherwise, with optimal objective value $$b_1+b_2+b_3+b_3+b_3 = 1+3+6+6+6 = 22,$$ as you claimed.
For a large number of gifts, a column generation approach will typically be more efficient.