Question Link - https://atcoder.jp/contests/abc177/tasks/abc177_e

My solution - https://ideone.com/CUJSSt

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.