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: // Generated by Code Flattener.
  // https://plugins.jetbrains.com/plugin/9979-idea-code-flattener
  
  import java.io.*;
  import java.math.BigInteger;
  import java.util.StringTokenizer;
  
  public class Main {
      public static void main(String[] args) {
          Solution solution = new ASolution();
          boolean local = System.getProperty("ONLINE_JUDGE") == null && !solution.isInteractive();
          String input = local ? "input.txt" : null;
          solution.in = new MyScanner(input);
          solution.out = MyWriter.of(null);
          solution.bm = new Benchmark();
          solution.al = new Algorithm();
          solution.run();
          solution.close();
      }
  
      private abstract static class Solution {
          public MyScanner in;
          public MyWriter out;
          public Benchmark bm;
          public Algorithm al;
  
          public void init() {
          }
  
          public abstract void solve();
  
          protected boolean isMultiTest() {
              return true;
          }
  
          public void run() {
              init();
              if (isMultiTest()) {
                  int t = in.nextInt();
                  for (int i = 0; i < t; i++) {
                      solve();
                  }
              } else {
                  solve();
              }
          }
  
          public void close() {
              out.close();
          }
  
          public boolean isInteractive() {
              return false;
          }
      }
  
      private static class ASolution extends Solution {
          BigInteger need(BigInteger x, BigInteger[] b) {
              BigInteger count = BigInteger.ZERO;
              for (BigInteger l : b) {
                  BigInteger tmp = x.divide(l);
                  x = x.subtract(l.multiply(tmp));
                  count = count.add(tmp);
              }
              return count;
          }
  
          public void solve() {
              int n = in.nextInt();
              BigInteger k = BigInteger.valueOf(in.nextInt());
              int[] a = in.nextInts(n);
              BigInteger[] b = new BigInteger[n];
              for (int i = 0; i < n; i++) {
                  b[n - 1 - i] = BigInteger.TEN.pow(a[i]);
              }
              BigInteger ans = BigInteger.ZERO;
              for (int j = 20; j >= 0; j--) {
                  BigInteger x = BigInteger.TEN.pow(j);
                  BigInteger count1 = need(x.subtract(BigInteger.ONE), b);
                  BigInteger count2 = need(x, b);
                  ans = ans.multiply(BigInteger.TEN);
                  if (count1.compareTo(k) <= 0) {
                      BigInteger tmp = k.subtract(count1);
                      BigInteger tmp2 = tmp.divide(count2).add(BigInteger.ONE);
                      ans = ans.add(tmp2);
                      k = k.subtract(tmp2.multiply(count2));
                  }
              }
              out.println(ans);
          }
      }
  
      private static class MyScanner {
          private final BufferedReader br;
          private StringTokenizer st;
  
          public MyScanner(String fileName) {
              if (fileName != null) {
                  try {
                      File file = new File(getClass().getClassLoader().getResource(fileName).getFile());
                      br = new BufferedReader(new FileReader(file));
                  } catch (FileNotFoundException e) {
                      throw new RuntimeException(e);
                  }
              } else {
                  br = new BufferedReader(new InputStreamReader(System.in));
              }
          }
  
          public String next() {
              while (st == null || !st.hasMoreElements()) {
                  st = new StringTokenizer(nextLine());
              }
              return st.nextToken();
          }
  
          public int nextInt() {
              return Integer.parseInt(next());
          }
  
          public int[] nextInts(int n) {
              int[] arr = new int[n];
              for (int i = 0; i < n; i++) {
                  arr[i] = nextInt();
              }
              return arr;
          }
  
          public String nextLine() {
              try {
                  String line = br.readLine();
                  if (line == null) {
                      throw new RuntimeException("empty line");
                  }
                  st = null;
                  return line;
              } catch (IOException e) {
                  throw new RuntimeException(e);
              }
          }
      }
  
      private static class Benchmark {
      }
  
      private static class Algorithm {
      }
  
      private static class MyWriter extends PrintWriter {
          public static MyWriter of(String fileName) {
              if (fileName != null) {
                  try {
                      return new MyWriter(new FileWriter(fileName));
                  } catch (IOException e) {
                      throw new RuntimeException(e);
                  }
              } else {
                  return new MyWriter(new BufferedOutputStream(System.out));
              }
          }
  
          public MyWriter(Writer writer) {
              super(writer);
          }
  
          public MyWriter(OutputStream out) {
              super(out);
          }
      }
  }