You have to select a multiset of prime numbers from the firstm prime numbers such that the sum of the selected primes is exactlyn. You may use each prime number multiple times.
Return the minimum number of prime numbers needed to sum up to n, or -1 if it is not possible.