Skip to content
the poor coder

HackerEarth - Special Sum Solution

Poor Man
Published
Updated
Reading time
1 min read

Special Sum of number N is defined as follows:

def foo(n):

{

Text
  ret = 0

  for i = 1 to n:
  {

     if gcd(n,i) is 1:

             ret += 1
   }
  return ret

}

def SpecialSum(N):

{

Text
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

SAMPLE INPUT

1

5

SAMPLE OUTPUT

5

Solution in python

Python
for i in range(int(input())):
    print(int(input()))

Keep going

2020

HackerEarth - Molly And Flame Solution

Molly is in love with Sherlock. She wants to decide the nature of the relationship between her and Sherlock using the game of FLAME. FLAME stands for: {“Friendship”,”Love”,”Affection”,”Marriage”,”Enemies”} The rules of…

2020

HackerEarth - Josh and Hotel Solution

Josh owns a hotel, there are X rooms in the hotel and every room can be allocated to maximum 1 person at a time. If a customer arrives and there are no rooms available, the customer will leave the hotel without staying…

ESC