First K Digits
Submissions: 377   Accuracy:

32.07%

  Difficulty: Easy   Marks: 2

Given a positive integer n, print first k digits after point in value of 1/n.

Your program should avoid overflow and floating point arithmetic.

Input:

First line of input contains the number of test cases.

The only line of each test case contains 2 spaced integers n and k.
 

Output:

Output the first k digits.

Constraints:
1<=T<=100

1<=N<=10000

1<=K<=10000

Example:

Sample Input:

2
3 3
50 4

Sample Output:

333
0200

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

Author: jain_rishabh


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.