CF402D Upgrading Array

Description

You have an array of positive integers $ a[1],a[2],...,a[n] $ and a set of bad prime numbers $ b_{1},b_{2},...,b_{m} $ . The prime numbers that do not occur in the set $ b $ are considered good. The beauty of array $ a $ is the sum ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF402D/aea4eb2d17c24d3a2d1067454589473b9ea01095.png), where function $ f(s) $ is determined as follows: - $ f(1)=0 $ ; - Let's assume that $ p $ is the minimum prime divisor of $ s $ . If $ p $ is a good prime, then ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF402D/8afcd99c67c49a2d759fe9b7228c1f8d0e576b6a.png), otherwise ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF402D/cce5ab868ac31145b115c9c6f231d8d473326030.png). You are allowed to perform an arbitrary (probably zero) number of operations to improve array $ a $ . The operation of improvement is the following sequence of actions: - Choose some number $ r $ ( $ 1

Input Format

N/A

Output Format

N/A

Explanation/Hint

Note that the answer to the problem can be negative. The GCD( $ x_{1} $ , $ x_{2} $ , ..., $ x_{k} $ ) is the maximum positive integer that divides each $ x_{i} $ .