Special Sum
Practice
4.4 (14 votes)
Approved
Easy
Math
Open
Problem
64% Success 12079 Attempts 20 Points 5s Time Limit 256MB Memory 1024 KB Max Code

Special Sum of number N is defined as follows:

def foo(n):

{

  ret = 0

  for i = 1 to n:
  {

     if gcd(n,i) is 1:

             ret += 1
   }
  return ret

}

def SpecialSum(N):

{

ret=0

for i = 1 to N:

{

      if i divides N:

         ret += foo(i)
 }

 return ret

}

Given a N print SpecialSum(N).

Input:

First line contains T, the number of testcases.

Each testcase consists of one line containing N.

Output:

Print in one line for each testcase the required answer.

Constraints:

1 <= T <= 1000

1 <= N <= 10^10

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
22 votes
Tags:
Ad-HocApprovedEasyImplementationMathOpen
Points:20
19 votes
Tags:
ApprovedBasic ProgrammingEasyMathOpen
Points:20
15 votes
Tags:
AlgorithmsEasyHash MapsSorting