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.util.StringTokenizer;
  import java.io.InputStreamReader;
  import java.io.OutputStreamWriter;
  import java.lang.reflect.Array;
  import java.io.IOException;
  import java.io.BufferedReader;
  import java.io.BufferedWriter;
  import java.math.BigInteger;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.ArrayList;
  
  public class p3
  {
  	BufferedReader br;
  	StringTokenizer st;
  	BufferedWriter bw;
  	public static void main(String[] args)throws Exception
  	{
  		new p3().run();
  	}
  	void run()throws IOException
  	{
  		br = new BufferedReader(new InputStreamReader(System.in));
  		bw=new BufferedWriter(new OutputStreamWriter(System.out));
  
  		solve();
  	}
  	void solve() throws IOException
  	{
  		short t=ns();
  		while(t-->0)
  		{
  			byte n=nb();	int k=ni();
  			byte a[]=new byte[n]; for(int i=-1;++i<n;)a[i]=nb();
  
  			long ans=0;
  
  			int i=0;
  			for(;++i<n;)
  			{
  				int b=(int)Math.pow(10,a[i]-a[i-1]);
  				if(k>=b-1)
  				{
  					k-=b-1;
  					ans=(int)Math.pow(10,a[i])-1;
  				}
  				else
  					break;
  			}
  			k++;
  			ans+=(long)Math.pow(10,a[i-1])*k;
  			System.out.println(ans);
  		}
  	}
  
  
  
  
  
  
  	public int gcd(int a, int b)
  	{
  		if(a==0)
  			return b;
  		else
  		 return gcd(b%a,a);
  	}
  
  	int[] nai(int n) { int a[]=new int[n]; for(int i=-1;++i<n;)a[i]=ni();	return a;}
  
  	long[] nal(int n) { long a[]=new long[n]; for(int i=-1;++i<n;)a[i]=nl();	return a;}
  
  	char[] nac()	{char c[]=nextLine().toCharArray();	return c;}
  
  	char [][] nmc(int n)	{char c[][]=new char[n][]; for(int i=-1;++i<n;)c[i]=nac();	return c;}
  
  	int[][] nmi(int r, int c)	{int a[][]=new int[r][c]; for(int i=-1;++i<r;)a[i]=nai(c);	return a;}
  
  	String next()
  	{
  			while (st == null || !st.hasMoreElements()) {
  					try {
  							st = new StringTokenizer(br.readLine());
  					}
  					catch (IOException e) {
  							e.printStackTrace();
  					}
  			}
  			return st.nextToken();
  	}
  
  	int ni() { return Integer.parseInt(next()); }
  
  	byte nb() { return Byte.parseByte(next()); }
  
  	short ns() { return Short.parseShort(next()); }
  
  	long nl() { return Long.parseLong(next()); }
  
  	double nd()	{	return Double.parseDouble(next());	}
  
  	String nextLine()
  	{
  			String str = "";
  			try {
  					str = br.readLine();
  			}
  			catch (IOException e) {
  					e.printStackTrace();
  			}
  			return str;
  	}
  
  	int countDigits(int l)	{
  		if (l >= 1000000000) return 10;
  		if (l >= 100000000) return 9;
  		if (l >= 10000000) return 8;
  		if (l >= 1000000) return 7;
  		if (l >= 100000) return 6;
  		if (l >= 10000) return 5;
  		if (l >= 1000) return 4;
  		if (l >= 100) return 3;
  		if (l >= 10) return 2;
  		return 1;
  	}
  	int countDigits(long l) {
  		if (l >= 1000000000000000000L) return 19;
  		if (l >= 100000000000000000L) return 18;
  		if (l >= 10000000000000000L) return 17;
  		if (l >= 1000000000000000L) return 16;
  		if (l >= 100000000000000L) return 15;
  		if (l >= 10000000000000L) return 14;
  		if (l >= 1000000000000L) return 13;
  		if (l >= 100000000000L) return 12;
  		if (l >= 10000000000L) return 11;
  		if (l >= 1000000000L) return 10;
  		if (l >= 100000000L) return 9;
  		if (l >= 10000000L) return 8;
  		if (l >= 1000000L) return 7;
  		if (l >= 100000L) return 6;
  		if (l >= 10000L) return 5;
  		if (l >= 1000L) return 4;
  		if (l >= 100L) return 3;
  		if (l >= 10L) return 2;
  		return 1;
  	}
  }