You can express all groups as linear equations, the grouping 1 in the first example would give 1*x_{1}+1*x_{2}+1*x_{3}+1*x_{4}=17.150, where x_{i}is the income of person i.

This can be expressed as a single equation Ax=b, where A is a matrix with just 0 and 1 (each line encodes the group members of one group) and b are the total incomes of the corresponding groups.

There are standard methods (like Gauß) to try to solve those systems, and if one or more values in x can be gained, I think these algorithms can identify that with a polynomial complexity.