BETA

Difficulty Level: Basic

Total Submissions: 1113 Accuracy:

9.52%

Minimum sum of factors
     

Given a number, find minimum sum of its factors.

Input:
First line consists of T, test cases. Only line of every test case consists of an integer N

Output:
Single line output, print the Sum of factors.

Constraints:
1<=T<=100000
1<=N<=100000

Example:
Input:

2
11
12
Output:
12
7

Explanation:
Following are different ways to factorize 12 and sum of factors in different ways.
12 = 12 * 1 = 12 + 1 = 13
12 = 2 * 6 = 2 + 6 = 8
12 = 3 * 4 = 3 + 4 = 7
12 = 2 * 2 * 3 = 2 + 2 + 3 = 7
Therefore minimum sum is 7

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.