Possible values of Q such that , for any value of R , their product is equal to X times their sum | C # program for the above approach ; Function to find all possible values of Q ; List 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
using System ; using System . Collections . Generic ; class GFG { static void values_of_Q ( int X ) { List < int > val_Q = new List < int > ( ) ; for ( int i = 1 ; i <= X ; i ++ ) { if ( ( ( ( X + i ) * X ) ) % i == 0 ) { val_Q . Add ( X + i ) ; } } Console . WriteLine ( val_Q . Count ) ; for ( int i = 0 ; i < val_Q . Count ; i ++ ) { Console . Write ( val_Q [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int X = 3 ; values_of_Q ( X ) ; } }