代码:
1 import java.util.*;
2 public class Main {
3 public static void main (String [] args) {
4 int repeat,a,n;
5 Scanner s=new Scanner(System.in);
6 repeat=s.nextInt();
7 for(int i=1;i<=repeat;i++) {
8 a=s.nextInt();
9 n=s.nextInt();
10 int sum=0;
11 int p=a;
12 for(int j=1;j<=n;j++)
13 {
14 sum+=p;
15 p=p*10+a;
16 }
17 System.out.println(sum);
18 }
19 }
20 }