Difficulty Level: Easy

Submissions: 405 Accuracy:


Make the hit in power game !

There are two integers (X and N). You have to made a number in such a way that it contains the first digit and last digit in occurring in X, X, X3,  .... XN.

lets take  X=12 and N=5.
let l is last digit and f is first digit.
121  = 12  he first digit of 12 is 1(f1) and last digit is 2 (l1).
122 = 144 the first digit of 144 is 1 (f2) and last digit is 4 (l2).
123 = 1728 the first digit of 1728 is 1 (f3) and last digit is 8  (l3).
124 = 20736 the first digit of 20736 is 2 (f4) and last digit is 6 (l4).
125 = 248832 the first digit of 248832 is 2 (f5) and last digit is 2 (l5).
We made a no in the format f1 l1 f2 l2 f3 l3 f4 l4 f5 l5 .
so no becomes 1214182622.

Input Format-
The no of test cases t , followed by t no's of  X and N .

Output format-
f1 l1 f2 l2 ... fN lN.
each case output should be in new line.


Sample Input-
10 5
19 4

Sample Output-


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

Author: Shubham Nagaria

Set Default Code

It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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