12043 - Divisors
Solution Description : Simple Math problem Pregenerate number of divisor and sum of all divisors from 1 to 100000 for i=1 to 100000 ---for j=1 to sqrt(i) ------if i%j equal zero then ----------add 2 to number of divisor and set x=i/j and y=i/x add x+y to sum of divisor input a,b and k for i=a to b -----if i%k equal zero then -------- add number of divisor for i to total number of divisor and add sum of divisor for i to total sum of divisor print total number of divisor and total sum of divisor |
||||||||||