Function to check if all the pairs of the array are coprime with each other or not
bool allCoprime ( int A [ ] , int n ) { bool all_coprime = true ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) {