0029. 0's and 1's
Input file name: | 01.in |
Output file name: | 01.out |
Time limit: | 2 s |
Memory limit: | 64 megabytes |
Vitya learned in his school about different scales of notation. When he returned home in the evening Vitya guessed that there are two digits allowed in any scale of notation – they are 0 and 1. And he started to construct equalities in different scales where only 0's and 1's were allowed. There were no problems with addition, but multiplication interested him more. Vitya noticed that the equality 11*11=1001 is only true in the binary scale of notation, but it is false in any other.
Now he wants to construct such an equality for other scales of notation. Write a program for Vitya which given a base of the scale will display an equality in form A*B=C (where A, B and C contain only 0's and 1's) or decide that it is impossible.
Input file
The input file contains only one number Z representing the base of the selected scale of notation. Z is in range 2≤ Z≤ 36.
Output file
If it is possible to construct such an equality display any in the only line of the output file using pattern A*B=C. The equality is to be true only in the scale of notation with base Z and false in any other. If it is impossible leave the output file empty.
The output file size is limited to 10000 bytes.
Examples:
01.in | 01.out |
---|---|
2 | 11*11=1001 |
Source: Petrozavodsk training camp, Summer 2002. Startup contest
Author: Andrew Lopatin, Nick Durov
Discuss Submit a solution