Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Smart Sister
Description Yesterday, Kamran was working on a report, which he must submit to his boss next Saturday. He became tired and went out of his working room to take a nap. After some minutes, her sister, Kamelia, who is a first year university student, came to the room and found the report. She thought, "How many large positive integers in a document. I hate these large numbers, they make me see nightmares! I should represent them in a more compact way". At first, she devised an ambiguous way to represent a number. She computed the product of digits of a number to find a new number and repeated this process again and again until she reached a one digit number (For example, 972 was transformed to 126 and then to 12 and finally to 2). But she simply understood that this process is not reversible and tried to find another way (Since she loves Kamran too much, she did not want to destroy his efforts!). Suddenly, she noticed an interesting property in all the numbers of the report and called it productivity property in her mind. By her definition, a number with productivity property is a number that can be obtained by multiplying the digits of some other number (for instance, 126, 12, and 2 has productivity property, because they can be obtained from 972, 126, and 12 respectively). She thought, "Wow, I found it. If a number It is not hard to imagine, how loudly Kamran screamed when he saw the report and the note from Input Input begins with a number Output For each test case, your program must output the original number Sample Input 4 10 1 40 11 Sample Output 10 1 80 12 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator