Playing with divisors

https://ide.codingblocks.com/s/189681 plese tell error in code

@sgdon142
Your logic isn’t correct. Secondly the function prime_factor() runs in ( 10^5 ) ^ 2 time which is around a 100 second.

For each prime in input array do the following : tmp[ i ] = (val*(val+1))/2 * factors( i )
where val = inp[ i ]
factors( i ) is a function which calculates product of inp[ i ] + for all indexes other than i

Finally take product ( tmp[ i ] + 1 ) for i = 1 to n

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.