#d2676. 整除光棍
整除光棍
Divisible Repunit
Problem Description
Here the so-called "lonely number" does not refer to a single person~ it refers to a number consisting entirely of s, such as , etc. Legend has it that any lonely number can be divided by an odd number that does not end with . For example, can be divided by . Now your program should read an integer , which is definitely an odd number and does not end with . Then, after calculation, output two numbers: the first number , meaning that multiplied by is a lonely number, and the second number is the number of digits of this lonely number. Such a solution is of course not unique; you are asked to output the smallest solution.
Hint: an obvious method is to gradually increase the number of digits of the lonely number until it is divisible by . But the difficulty is that may be a very large number — for example, if the program inputs , it should output and , because multiplied by equals , which has ones in total.
Input Format
A single line containing a positive odd number that does not end with ().
Output Format
Output the corresponding smallest and in one line, separated by a single space.
Sample Input
31
Sample Output
3584229390681 15