Submit solution
Points:
25 (partial)
Time limit:
1.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
C, C++, Java, Pascal, Python
Unique Multiplication
Consider the following multiplication example: x = . The interesting fact is that all nine digits are different, and there is no involved.
Construct a program named digits.c or digits.pas depending on the programming language used.
Your program will take as input a file named digits.in. This file will contain an integer , where .
Your program should output to a file named digits.out with line, containing:
- two integers and , such that x = , and all digits of are different from each other (and without containing ). There should be a single space between the two numbers and .
or
- the number , if there are no suitable and such that x = .
Input/Output File Examples:
1st
STDIN (digits.in)
48
STDOUT (digits.out)
159 7632
2nd
STDIN (digits.in)
51
STDOUT (digits.out)
0
Time Limit: sec per testcase.
Clarification: Each line, both in the input and output files, ends with a newline character (for C and C++ programmers: "\n", while for Pascal programmers the use of ReadLn and WriteLn is sufficient).
Comments