Possible values of Q such that , for any value of R , their product is equal to X times their sum | Function to find all possible values of Q ; Vector initialization to store all numbers satisfying the given condition ; Iterate for all the values of X ; Check if condition satisfied then push the number ; Possible value of Q ; Print all the numbers ; Driver Code
def values_of_Q ( X ) : NEW_LINE INDENT val_Q = [ ] NEW_LINE for i in range ( 1 , X + 1 ) : NEW_LINE INDENT if ( ( ( ( X + i ) * X ) ) % i == 0 ) : NEW_LINE INDENT val_Q . append ( X + i ) NEW_LINE DEDENT DEDENT print ( len ( val_Q ) ) NEW_LINE for i in range ( len ( val_Q ) ) : NEW_LINE INDENT print ( val_Q [ i ] , end = " ▁ " ) NEW_LINE DEDENT DEDENT X = 3 NEW_LINE values_of_Q ( X ) NEW_LINE