my @n = get; my @a = get.words; my @b = get.words; say @b.permutations.map({ sum map({[R-] $_},($_ Z@a))Xmax 0 }).Bag.max.value