Prove us Wrong!

0

0 votes
Medium
Problem

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.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?