my @input = qw/ 2 5 7 /; my $target = 15; my @want_output = ( (5 5 5) (2 2 2 2 7) .... ) my $target2 = 3 my @want_output = fail;