Prove us Wrong!
Practice
4.5 (2 votes)
Medium
Problem
15% Success 64 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

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.

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
Tags:
C++CountingMathSpecial NumbersCombinatorics
Points:30
7 votes
Tags:
MathematicsMedium
Points:30
2 votes
Tags:
Dynamic ProgrammingCombinatoricsAd-HocMediumAlgorithmsMathematicsOpenApproved