F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

All Can Do

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 752    Accepted Submission(s): 296


Problem 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
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-24 23:16:22, Gzip enabled