All Can Do

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 3184
64-bit integer IO format: %I64d      Java class name: Main

Description

Construct a number N follows three below restrictions:
1. T-1 <= Log10N < T, ( 0 < T <= 100 )
2. 90 mod b = 0
3. N mod b = 0
Please help me find the biggest N.

Input

The first line contains an integer t means the number of test cases.
Then each line will contain two integers T and b.

Output

For each case, output N in one line, if there is no such answer, output "Impossible!".

Sample Input

3
2 45
1 10
2 5

Sample Output

90
Impossible!
95

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .