Naruto and His New Jutsu

3.1

17 votes
Mathematics, Easy, Divisors, Mathematics, Mathamatics
Problem

Naruto learned a new jutsu (magical attack). The jutsu of intensity N requires chakra (energy) equal to the sum of odd divisors of N. Naruto wants to calculate the amount of chakra that will be used in this jutsu given the amount of intensity of the jutsu.

enter image description here

Input Format
The first line of input contains a single integer T denoting the number of test cases.
Each test case contains an integer N in a separate line.

Output Format
For each test case, print a single integer denoting the answer to that test case a new line.

Constraints

  • 1T103
  • 1N109

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

For 10, the divisors are 1, 2, 5 and 10. Hence, the sum of odd divisors is 1+5=6.

Editor Image

?