
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Prime-factorize ki and count how many ways you can distribute the primes among the ni positions.
After prime factorizing ki, suppose there are x amount of prime factor. There are (x + n - 1) choose (n - 1) ways to distribute the x prime factors into n positions, allowing repetitions.