#include <bits/stdc++.h>
#pragma warning(disable : 4996)
const long long MOD = 1000000007;
const int maxn = 1e6 + 5;
const double Inf = 10000.0;
const double PI = acos(-1.0);
using namespace std;
long long mul(long long a, long long b, long long m) {
  long long res = 0;
  while (b) {
    if (b & 1) res = (res + a) % m;
    a = (a + a) % m;
    b >>= 1;
  }
  return res % m;
}
long long quickPower(long long a, long long b, long long m) {
  long long base = a;
  long long ans = 1ll;
  while (b) {
    if (b & 1) ans = mul(ans, base, m);
    base = mul(base, base, m);
    b >>= 1;
  }
  return ans;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long Lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int readint() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long readll() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
unsigned long long readull() {
  unsigned long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
void Put(long long x) {
  if (x < 0) putchar('-'), x *= -1;
  if (x > 9) Put(x / 10);
  putchar(x % 10 + '0');
}
map<int, int> mp;
int main() {
  int T = readint();
  while (T--) {
    mp.clear();
    int n = readint();
    int x;
    int k = -1;
    int cnt = 0;
    for (int i = 0; i < n; i++) x = readint(), mp[x]++;
    for (auto it = mp.begin(); it != mp.end(); it++) k = max(k, it->second);
    for (auto it = mp.begin(); it != mp.end(); it++)
      if (it->second == k) cnt++;
    cnt--;
    printf("%d\n", (cnt + k - n) / (1 - k));
  }
}
