for each element of input array create a structure element to store its index and factors count
for ( int i = 0 ; i < n ; i ++ ) { num [ i ] . index = i ; num [ i ] . no_of_fact = countFactors ( arr [ i ] ) ; }