Sum of Divisors in an array
Submissions: 651   Accuracy:

32.76%

  Difficulty: Easy   Marks: 2

Given an array of natural numbers count the sum of its proper divisors for every element in the array.

Input:
The first line of the input contains an integer T which denotes the number of test cases to follow. Each test case contains the number of elements in the array a[] as n and next line contains space separated n elements in the array.

Output:
Print an array of n integers ith of which represents the sum of divisors of the ith number in the array.

Constraints:
1<=T<=100
1<=n<=100
1<=a[i]<=1000‚Äč

Example:
Input:

1
7
8 13 24 36 59 75 87

Output:

7 1 36 55 1 49 33

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

Contributor: Shashwat Jain
Author: shashwat jain


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.