Smallest K digit number divisible by X
Submissions: 803   Accuracy:

36.52%

  Difficulty: Basic   Marks: 1

Given two integers X and K. The task is to find smallest K-digit number divisible by X.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains two integers X and K as input. It is given that number of digits in X is always smaller or equal to K.

Output:
For each test case, print smallest K-digit number divisible by X in new line .

Constraints:
1<=T<=100
1<=X<=105
1<=K<=18

Example:
Input:

2
6 1
5 2

Output:
6

10

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Arun Tyagi
Author: arun03


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.