Steve Jobsoong
Time limit1sMemory limit128 MB
Find every natural number below 10^8 whose product with the given X moves its first digit to the last position.
- Level
Medium6 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Steve Jobsoong opens every talk with a math trick to pull the audience in.
His first trick is that the square root of a number is the back half of its digits. (, )
His second trick is that multiplying a number by gives the number you get by moving its first digit to the last position. (, )
The audience went wild over the second trick, so Jobsoong wants to know whether some other than has the same property.
Given , write a program that finds every number whose product with equals the number obtained by moving its first digit to the last position.
Input
The first line contains . ()
is given with at most four digits after the decimal point.
Output
Print every natural number smaller than whose product with equals the number obtained by moving its first digit to the last position, one per line in increasing order.
If no such number exists, print No solution.