#t75. 约数之和

约数之和

Sum of Divisors

Problem Description

Compute the sum of all numbers, among nn given natural numbers, that can be divisors of mm.

Input Format

The first line contains a positive integer n(0<n≤105)n(0 \lt n \le 10^5).

The second line contains nn consecutive natural numbers, each not greater than 10510^5.

The third line contains a positive integer m(0≤m<231)m(0 \le m \lt 2^{31}).

Output Format

Output the sum of all numbers among the nn that are divisors of mm.

Sample Input 1

5
2 3 2 5 6
30

Sample Output 1

18

Sample Input 2

5
2 3 2 5 6
7

Sample Output 2

0

Hint

Sample 1: 2, 3, 5, 6 are all divisors of 30; among them 2 appears twice, so the sum of all divisors is 18.