All Tracks Math Problem

Prove us Wrong!
Tag(s):

Medium

Problem
Editorial
Analytics

We don't think you can solve this question. Prove us wrong!

Given a single digit N.
You need to find the smallest number X such that after performing one right circular shift on X, the new number is N times the original number.

Input:

T, the number of test cases. A single digit N each test case.
1 <= N <= 9
1 <= T <= 9

Output:

The required number X.
Note: NUmbers with leading zeroes are not considered.

SAMPLE INPUT
1
1
SAMPLE OUTPUT
1
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++, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala 2.11.8, Swift, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications