Given an array ofnintegersa1,a2,...,an,we saya set{i,j}is a prime set of the given array, ifi ≠ jand ai + aj is prime. BaoBao has just found an array of nintegersa1,a2,...,anin his pocket.He would like to select at most kprime set of that array to maximize the size of the union of the selected sets. That is to say, to maximizeby carefully selecting mand p1,p2,...pm,where m≤ kand piis a prime set of the given array.Please help BaoBao calculate the maximum size of the union set.
Given an array of n integers a1,a2,...,an,we say a set {i,j} is a prime set of the given array, if i ≠ j and ai + aj is prime. BaoBao has just found an array of n integers a1,a2,...,anin his pocket. He would like to select at most k prime set of that array to maximize the size of the union of the selected sets. That is to say, to maximize by carefully selecting m and p1,p2,...pm, where m ≤ k and pi is a prime set of the given array. Please help BaoBao calculate the maximum size of the union set.