you give array n n geq 2 positive integer integer p consider undirected weighted graph n vertex number 1 n edge vertice j ij add follow manner if gcda_i a_i1 a_i2 dot a_j mina_i a_i1 a_i2 dot a_j edge weight mina_i a_i1 a_i2 dot a_j j if i1j edge weight p j here gcdx y ldot denote great common divisor GCD integers x y Note multiple edge j condition true condition fail j edge verticesThe goal find weight minimum span tree graph