Question Link - E - Coprime
My solution - CUJSSt - Online C++0x Compiler & Debugging Tool - Ideone.com
If the gcd of the array is not equal to 1, then the answer is ‘not co-prime’.
If all the pairs are co-prime then the product of all the elements will be equal to lcm of the array and gcd will be 1, and in such cases answer will be ‘pairwise coprime’.
If the gcd of the array is 1 but the lcm of the array is not equal to the product of all the elements in array then it will be ‘setwise coprime’.
My solution is giving WA on 6 sub tasks and passing rest of the cases.