Under construction

Still being built. Things may change

Adding the Exponents

Interview

Time limit1sMemory limit128 MB

Summary
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 P={p1,p2,⋯ ,pN}P=\{p_1, p_2, \cdots, p_N\} consists of NN distinct primes.

For a positive integer ii, let bib_i be the maximum value of ∑j=1Naj\sum_{j=1}^{N}{a_j} such that ip1a1×p2a2×⋯×pNaN\frac{i}{p_1^{a_1}\times p_2^{a_2}\times \cdots \times p_N^{a_N}} is a positive integer. (aja_j is an integer.)

Given the set PP and a positive integer KK, find the value of ∑i=1Kbi\sum_{i=1}^{K} b_{i}.

Input

The first line contains NN (1≤N≤200 0001\leq N \leq 200\,000), the number of elements in PP.

The second line contains NN distinct primes pp (1≤p≤3×1061\leq p \leq 3\times 10^{6}) separated by spaces, the elements of PP.

The third line contains a positive integer KK (1≤K≤10121\leq K \leq 10^{12}).

Output

Print the value of ∑i=1Kbi\sum_{i=1}^{K} b_{i}.

Examples1

  1. Example 1

    Input
    2
    2 3
    100
    
    Expected output
    145