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<=10^{5}

1<=K<=18

**Example:
Input:**

2

6 1

5 2

**Output:**

6

10

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.

ShubhamJain18 | 205 |

makeitdonesolo | 140 |

lost_found | 124 |

maggiiiii | 118 |

SahatPrasad1 | 108 |

Bishnu Dev Panda | 777 |

okayboss | 551 |

ShubhamJain18 | 516 |

yk12 | 514 |

makeitdonesolo | 480 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4925 |

Quandray | 4547 |

Login to report an issue on this page.