Adding the Exponents
InterviewTime limit1sMemory limit128 MB
Given N distinct primes and K up to 10^12, find the sum over i from 1 to K of how many times the primes in P divide i, counted with multiplicity.
- Level
Medium4 of 10
- Topics
- Number theory, Math
- Solved
- No attempts yet
Problem
A set consists of distinct primes.
For a positive integer , let be the maximum value of such that is a positive integer. ( is an integer.)
Given the set and a positive integer , find the value of .
Input
The first line contains (), the number of elements in .
The second line contains distinct primes () separated by spaces, the elements of .
The third line contains a positive integer ().
Output
Print the value of .