description: In Berland, n different types of banknotes are used. Banknotes of the i-th type have denomination 10^{a_i} burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly 1.
  
  Let's denote f(s) as the minimum number of banknotes required to represent exactly s burles. For example, if the denominations of banknotes used in Berland are 1, 10 and 100, then f(59) = 14: 9 banknotes with denomination of 1 burle and 5 banknotes with denomination of 10 burles can be used to represent exactly 9 ⋅ 1 + 5 ⋅ 10 = 59 burles, and there's no way to do it with fewer banknotes.
  
  For a given integer k, find the minimum positive number of burles s that cannot be represented with k or fewer banknotes (that is, f(s) > k).
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10^4) — number of test cases.
  
  The first line of each test case contains two integers n and k (1 ≤ n ≤ 10; 1 ≤ k ≤ 10^9).
  
  The next line contains n integers a_1, a_2, ..., a_n (0 = a_1 < a_2 < ... < a_n ≤ 9).
  
  Output
  
  For each test case, print one integer — the minimum positive number of burles s that cannot be represented with k or fewer banknotes.
  
  Example
  
  Input
  
  
  4
  3 13
  0 1 2
  2 777
  0 4
  3 255
  0 1 3
  10 1000000000
  0 1 2 3 4 5 6 7 8 9
  
  
  Output
  
  
  59
  778
  148999
  999999920999999999
solution: import java.io.BufferedReader;
  import java.io.BufferedWriter;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.OutputStreamWriter;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.Deque;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.LinkedList;
  import java.util.List;
  import java.util.Map;
  import java.util.PriorityQueue;
  import java.util.Queue;
  import java.util.Set;
  import java.util.stream.Stream;
  
  public class CasimirString {
  	
  	static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  	static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
  
  	
  	public static void main(String[] args) throws NumberFormatException, IOException {
  		// TODO Auto-generated method stub
  
  		int cases = Integer.parseInt(reader.readLine());
  		long[] tenPower = new long[10];
  		long pow = 1;
  		for(int i=0;i<10;i++) {
  			tenPower[i] = pow;
  			pow *= 10;
  		}
      	
      	while(cases-- > 0) {
      		
      		String[] firstLine = reader.readLine().split(" ");
      		long n = Long.parseLong(firstLine[0]);
      		long k = Long.parseLong(firstLine[1]);
      		
      		Integer[] deno = convertToIntArray(reader.readLine().split(" "));
      		long ans = 0;
      		k++;
      		
      		int i = 0;
      		
      		while(i<deno.length-1) {
      			if(k==0) {
      				break;
      			}
      			long count = (tenPower[deno[i+1]] - tenPower[deno[i]])/tenPower[deno[i]];
      			if(count > k) {
      				ans += k*tenPower[deno[i]];
      				k-=k;
      			}else {
      				ans += count*tenPower[deno[i]];
          			k-=count;
      			}
      			i++;
      		}
      		
      		if(k>0) {
      			ans += k*tenPower[deno[i]];
      			k-=k;
      		}
      		
      		printNumber(ans);
      		
      	}
      	
      	out.flush();
  	
  	}
  	
  	public static List<Integer> func(Integer[] arr, int index) {
  		
  		List<Integer> list = new ArrayList<>();
  		for(int i=index;i<arr.length;i+=2) {
  			
  			if((arr[i] > 0 && arr[i+1] > 0) || (arr[i] < 0 && arr[i+1] < 0)) {
  				list.add(-1*arr[i+1]);
  				list.add(arr[i]);
  			}else {
  				list.add(Math.abs(arr[i+1]));
  				list.add(Math.abs(arr[i]));
  			}
  			
  		}
  		return list;
  		
  	}
  	
  
  	public static Integer[] convertToIntArray(String[] str) {
  		Integer[] arr = new Integer[str.length];
  	    for(int i=0;i<str.length;i++) {
  	    	arr[i] = Integer.parseInt(str[i]);
  	    }
  	    return arr;
  	}
  	
  	public static Long[] convertToLongArray(String[] str) {
  		Long[] arr = new Long[str.length];
  	    for(int i=0;i<str.length;i++) {
  	    	arr[i] = Long.parseLong(str[i]);
  	    }
  	    return arr;
  	}
  	
  	public static void printYes() throws IOException {
  		out.append("YES" + "\n");
  	}
  	
  	public static void printNo() throws IOException {
  		out.append("NO" + "\n");
  	}
  	
  	public static void printNumber(long num) throws IOException {
  		out.append(num + "\n");
  	}
  	
  	public static long hcf(long a, long b) {
  		if(b==0) return a;
  		return hcf(b, a%b);
  	}
  	
  	public static int findSet(int[] parent, int[] rank, int v) {
          if(v==parent[v]) {
              return v;
          }
          parent[v] = findSet(parent, rank, parent[v]);
          return parent[v];
      }
      
      public static void unionSet(int[] parent, int[] rank, int a, int b) {
          
          a = findSet(parent, rank, a);
          b = findSet(parent, rank, b);
          
          if(a == b) {
              return;
          }
          
          if(rank[a] < rank[b]) {
              int temp = a;
              a = b;
              b = temp;
          }
          
          parent[b] = a;
          if(rank[a] == rank[b]) {
              rank[a]++;
          }
          
      }
      
      public static void makeSet(int[] parent, int[] rank, int v) {
          parent[v] = v;
          rank[v] = 0;
      }
  
  }
  