Number Theory- Vivek and factors

https://hack.codingblocks.com/contests/c/473/656

Please someone help me in this problem. I’m unable to build up the correct logic.

Hi
its kind of brute force approach (using Sieve ) calculate sum of factors of, till 10000 and check for what number sum if equal to s, (time complexity will be nlogn )

1 Like

The constraint in the problem is wrong. I wasted 1 hr on it and had to download the test inputs. It was mentioned in constraints that input is below 10^4 but it was checking for input beyond it(<=10^5). Please correct it.

check this https://ide.codingblocks.com/s/63076

Ooops!.. I’ll ask the admin to do so!
Thanks for Pointing out.
Just a suggestion in competitive programming constraints will be 10^5 or 10^9 similar to these kinds!. (10^4 is very rare in special case only ).

1 Like