If P and Q are both zero or if Q is zero and N is not divisible by P then there is no possible integer which satisfies the given conditions
if ( Q == 0 && ( P == 0 N % P != 0 ) ) { cout << " Not ▁ Possible " ; return ; } int count_P = 0 , count_Q = 0 ;