ZOJ Problem Set - 3312
It is 8th anniversary birthday of ZOJ. 8 is a lucky number for Chinese. So today let's use 8 8's to express number with parentheses and fundamental operations of arithmetic.
This problem contains up to 8888 test cases. Each test case contains an integer whose absolute value do not exceed 108 in one line.
For each case, output an expression whose value is equal to the given number. The length of the expression must not exceed 30. The expression must contain exactly 8 8's. Parenthese and fundamental operations can be added if neccesary. Any expression that can get the result is accepted. If it is impossible to do this, output "Impossible" in one line.
1111111 -88888888 1144
8888888/8 Impossible 8888-88*88
Author: GUAN, Yao
Source: ZOJ 8th Anniversary Contest