Math, asked by anulekshmi4846, 1 year ago

Given a positive number 's' , they have to find a number whose factors add up to 's'.

Answers

Answered by rishabh2004
0

Answer:

There are several cases . Each case of input will consist of a positive integer 'S'<= 100000 . The last case is followed by a value of 0 .

Constraints:

0 < S <= 10000

Output Format:

print the integer whose factors sum is equal to 'S'. Print the largest Integer whose factors sum is 'S' . If no such number exists, output '-1' .

Sample Input:

1

102

1000

0

Sample Output:

1

101

-1

Similar questions