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 X1 , X2 , 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.
The no of test cases t , followed by t no's of X and N .
f1 l1 f2 l2 ... fN lN.
each case output should be in new line.