Vivek and factors

what’s wrong with my code

If multiple numbers have same sum, we are required to output the maximum number.
Check this out for your reference : https://ide.codingblocks.com/s/211485