Factors Sum
Submissions: 1533   Accuracy:

36.06%

  Difficulty: Basic   Marks: 1

Given a number N, the task is to find the sum of all the divisors .

Input:
The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows, a single line of the input containing a positive integer N.

Output:
For each testcase, print the sum of all divisors/factors.

Constraints:
1<=T<=100

1<=N<=1000000

Example:
Input:

2
30
15

Output:
72
24

Explanation:
Testcase 1:
Factors sum 1 + 2 + 3 + 5 + 6 + 10 + 15 + 30 = 72
Testcase 2: Factors sum 1 + 3 + 5 + 15 = 24

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

Contributor: Sahil Chhabra
Author: Sahil_Chhabra


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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

to report an issue on this page.