public void solve() throws IOException {
    int tests = nextInt();
    for (int t = 1; t <= tests; t++) {
      int diners = nextInt();
      TreeMap<Integer, Integer> counts = new TreeMap<Integer, Integer>();
      for (int d = 0; d < diners; d++) {
        int cakes = nextInt();
        if (counts.containsKey(cakes)) {
          counts.put(cakes, counts.get(cakes) + 1);
        } else {
          counts.put(cakes, 1);
        }
      }
      int mintime = counts.lastKey();
      int highest = mintime, time = 0;
      while (highest > 3) {
        mintime = Math.min(mintime, highest);
        
        mintime = Math.min(mintime, highest + time);
      }
      out.format("Case #%d: %d%n", t, mintime);
    }
  }