SOLVE

LATER

Naina Function

Problem

Editorial

Analytics

Arun has a keen interest in maths and recently he came to know about weird function known as Naina function. Arun gave you a number "N" and asked you to evaluate Naina's function. The definition of Naina function is

F ( X ) = X , X <= 9

= F ( sum of digits in X )

where,
X = N^{3}

**Input:**

First line of input contains T - Total no. of test cases

Each test case contains the number "N".

**Output:**

For each testcase, print the value of Naina function.

**Constraints**

1<=T<=100

1<= Number of digits in N <= 10^{4}

Problem Setter : Satyam Swarnkar

Time Limit:
1.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Kotlin,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Visual Basic

Initializing Code Editor...

{"2656ff6": "/pagelets/show-submission/algorithm/naina-function/", "9400eb5": "/pagelets/problems-hint/algorithm/naina-function/", "c70eb9e": "/pagelets/recommended-problems/algorithm/naina-function/", "56e8a77": "/pagelets/suggested-problems/algorithm/naina-function/", "d9d241b": "/pagelets/problem-author-tester/algorithm/naina-function/"}

realtime.hackerearth.com

80

dd2e6f2822c2875219dd8ebf38ca0b6daa39dd6c

58a29e5cae2309f04b28

/realtime/pusher/auth/