If N % arr [ i ] = 0 , include arr [ i ] in a subset and recursively call for the remaining array integers
if ( N % arr [ i ] == 0 ) { ans = max ( ans , maximizeSubset ( N / arr [ i ] , arr , M , x + 1 ) + 1 ) ; } }