#include <bits/stdc++.h>
using namespace std;
void Err() {}
template <class T, class... A>
void Err(T a, A... x) {
  cerr << a << ',';
  Err(x...);
}
template <class X, class Y, class... A>
void Err(pair<X, Y> a, A... x) {
  cerr << '(' << a.first << ',' << a.second << "),";
  Err(x...);
}
template <template <class...> class T, class t, class... A>
void Err(T<t> a, A... x) {
  cerr << a.size() << ":{";
  for (auto v : a) Err(v);
  cerr << "},";
  Err(x...);
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long rnd(long long l, long long r) {
  return uniform_int_distribution<long long>(l, r)(rng);
}
template <class T>
void Min(T &a, const T b) {
  if (a > b) a = b;
}
template <class T>
void Max(T &a, const T b) {
  if (a < b) a = b;
}
const long long linf = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
const int N = 2e7 + 10, M = 500;
const long long mod = 1e9 + 7;
const long double eps = 1e-8;
int sgn(long double a) { return a < -eps ? -1 : (a < eps ? 0 : 1); }
int solve() {
  int n, ret;
  cin >> n;
  vector<int> ar(n);
  for (auto &i : ar) cin >> i;
  sort(ar.begin(), ar.end());
  if (ar.back() % 3 == 2) {
    ret = ar.back() / 3 + 1;
    for (auto i : ar)
      if (i % 3 == 1) {
        ret++;
        break;
      }
  } else if (ar.back() % 3 == 1) {
    ret = ar.back() / 3 + 1;
    bool f1 = 1, f2 = 1;
    for (auto i : ar) {
      if (i % 3 == 2) f1 = 0;
      if (i == ar.back() - 1 || i == 1) f2 = 0;
    }
    if (!f1 && !f2) ret++;
  } else {
    ret = ar.back() / 3;
    for (auto i : ar) {
      if (i % 3) {
        ret++;
        break;
      }
    }
  }
  return ret;
}
int main() {
  ;
  ios::sync_with_stdio(0), cin.tie(0);
  int _;
  cin >> _;
  while (_--) {
    cout << solve() << '\n';
  }
}

### Prompt

Your challenge is to write a CPP solution to the following problem:

One day, early in the morning, you decided to buy yourself a bag of chips in the nearby store. The store has chips of n different flavors. A bag of the i-th flavor costs a_i burles.

The store may run out of some flavors, so you'll decide which one to buy after arriving there. But there are two major flaws in this plan: 

  1. you have only coins of 1, 2 and 3 burles; 
  2. since it's morning, the store will ask you to pay in exact change, i. e. if you choose the i-th flavor, you'll have to pay exactly a_i burles. 



Coins are heavy, so you'd like to take the least possible number of coins in total. That's why you are wondering: what is the minimum total number of coins you should take with you, so you can buy a bag of chips of any flavor in exact change?

Input

The first line contains a single integer t (1 ≤ t ≤ 1000) — the number of test cases.

The first line of each test case contains the single integer n (1 ≤ n ≤ 100) — the number of flavors in the store.

The second line of each test case contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9) — the cost of one bag of each flavor.

Output

For each test case, print one integer — the minimum number of coins you need to buy one bag of any flavor you'll choose in exact change.

Example

Input


4
1
1337
3
10 8 10
5
1 2 3 4 5
3
7 77 777


Output


446
4
3
260

Note

In the first test case, you should, for example, take with you 445 coins of value 3 and 1 coin of value 2. So, 1337 = 445 ⋅ 3 + 1 ⋅ 2.

In the second test case, you should, for example, take 2 coins of value 3 and 2 coins of value 2. So you can pay either exactly 8 = 2 ⋅ 3 + 1 ⋅ 2 or 10 = 2 ⋅ 3 + 2 ⋅ 2.

In the third test case, it's enough to take 1 coin of value 3 and 2 coins of value 1.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
void Err() {}
template <class T, class... A>
void Err(T a, A... x) {
  cerr << a << ',';
  Err(x...);
}
template <class X, class Y, class... A>
void Err(pair<X, Y> a, A... x) {
  cerr << '(' << a.first << ',' << a.second << "),";
  Err(x...);
}
template <template <class...> class T, class t, class... A>
void Err(T<t> a, A... x) {
  cerr << a.size() << ":{";
  for (auto v : a) Err(v);
  cerr << "},";
  Err(x...);
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long rnd(long long l, long long r) {
  return uniform_int_distribution<long long>(l, r)(rng);
}
template <class T>
void Min(T &a, const T b) {
  if (a > b) a = b;
}
template <class T>
void Max(T &a, const T b) {
  if (a < b) a = b;
}
const long long linf = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
const int N = 2e7 + 10, M = 500;
const long long mod = 1e9 + 7;
const long double eps = 1e-8;
int sgn(long double a) { return a < -eps ? -1 : (a < eps ? 0 : 1); }
int solve() {
  int n, ret;
  cin >> n;
  vector<int> ar(n);
  for (auto &i : ar) cin >> i;
  sort(ar.begin(), ar.end());
  if (ar.back() % 3 == 2) {
    ret = ar.back() / 3 + 1;
    for (auto i : ar)
      if (i % 3 == 1) {
        ret++;
        break;
      }
  } else if (ar.back() % 3 == 1) {
    ret = ar.back() / 3 + 1;
    bool f1 = 1, f2 = 1;
    for (auto i : ar) {
      if (i % 3 == 2) f1 = 0;
      if (i == ar.back() - 1 || i == 1) f2 = 0;
    }
    if (!f1 && !f2) ret++;
  } else {
    ret = ar.back() / 3;
    for (auto i : ar) {
      if (i % 3) {
        ret++;
        break;
      }
    }
  }
  return ret;
}
int main() {
  ;
  ios::sync_with_stdio(0), cin.tie(0);
  int _;
  cin >> _;
  while (_--) {
    cout << solve() << '\n';
  }
}

```