2

# Ninja's Encryption

Difficulty: EASY
Contributed By
Arshit Babariya
Avg. time to solve
15 min
Success Rate
85%

Problem Statement

#### So your task is to find the encrypted form of a number using the ninja encryption technique and you were being provided with the number.

##### Input Format:
``````The first line contains an integer 'T' which denotes the number of test cases or queries to be run.

The first line of each test case contains a single integer ‘N’ denoting the given number.
``````
##### Output Format:
``````For each test case, print a single line containing the encrypted form of the number.

The output of each test case will be printed in a separate line.
``````
##### Note:
``````You do not need to print anything, it has already been taken care of. Just implement the given function.
``````
##### Constraints:
``````1 <= T <= 5
1 <= N <= 5000

Time Limit: 1 sec
``````
``````Can you do this in constant time and space?
``````
##### Sample Input 1:
``````2
5
8
``````
##### Sample Output 1:
``````7
9
``````
##### Explanation For Sample Input 1:
``````Test Case 1:
For the first test case, given number is ‘5’ so using the ninja encryption technique we follow the steps: ( 5 * 4 / 3 + 2 - 1 ) = 7

Test Case 2:
For the first test case, the given number is  ‘8’ so using the ninja encryption technique we follow the steps: ( 8 * 7 / 6 + 5 - 4 * 3 / 2 - 1 ) = 9
``````

#### Sample Input 2:

``````1
12
``````

#### Sample Output 2:

``````13
``````
Console