You have written on a piece of paper an array of
n positive integers
a[1],a[2],...,a[n] and
m good pairs of integers
(i1,j1),(i2,j2),...,(im,jm). Each
good pair
(ik,jk) meets the following conditions:
ik+jk is an odd number and
1≤ik<jk≤n.
In one operation you can perform a sequence of actions:
-
take one of the good pairs (ik,jk) and some integer v (v>1), which divides both numbers a[ik] and a[jk];
-
divide both numbers by v, i. e. perform the assignments: and .
Determine the maximum number of operations you can sequentially perform on the given array. Note that one pair may be used several times in the described operations.