#include <bits/stdc++.h>
using namespace std;
const double ME = 2.71828;
const int N = 1e7 + 20;
const int inf = 0x3f3f3f3f;
const double pi = 3.141592653;
void LOSER() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void file() { freopen("records.in", "r", stdin); }
long long gcd(long long a, long long b) { return (!b) ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long Fib_recur(long long n) {
  vector<long long> v(n + 5, 0);
  v[1] = 0;
  v[2] = 1;
  for (int i = int(3); i <= int(n); i++) v[i] = v[i - 1] + v[i - 2];
  return v[n];
}
bool isprime(long long n) {
  if (n == 1) return 0;
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return true;
}
bool comp(pair<long long, long long> &a, pair<long long, long long> &b) {
  if (a.first < b.first)
    return true;
  else if (a.first == b.first && a.second >= b.second)
    return true;
  else
    return false;
}
long long sumNatural(long long n) {
  long long sum = (n * (n + 1)) / 2;
  return sum;
}
long long sumNaturaleven(long long n) {
  long long sum = (n * (n + 1));
  return sum;
}
long long suminRange(long long l, long long r) {
  return sumNatural(r) - sumNatural(l - 1);
}
long long sumEven(long long l, long long r) {
  return sumNaturaleven(r / 2) - sumNaturaleven((l - 1) / 2);
}
string binary(long long n) {
  string s = "";
  bool neg = 0;
  if (n < 0) {
    n *= -1;
    neg = 1;
  }
  while (n > 0) {
    if (n % 2 == 0)
      s += '0';
    else
      s += '1';
    n /= 2;
  }
  reverse(((s).begin()), ((s).end()));
  if (neg) {
    s = '1' + s;
  }
  return s;
}
void Solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (auto &i : v) cin >> i;
  sort(((v).begin()), ((v).end()));
  int res = 1000;
  res /= v[0];
  cout << res * v[n - 1];
}
int main() {
  LOSER();
  long long t;
  cin >> t;
  while (t--) {
    Solve();
  }
}
