#include <bits/stdc++.h>
using namespace std;
const long long maxm = 1e5 + 5;
long long cnt[maxm];
long long a[maxm];
long long n;
signed main() {
  long long T;
  cin >> T;
  while (T--) {
    memset(cnt, 0, sizeof cnt);
    long long n;
    cin >> n;
    for (long long i = 1; i <= n; i++) {
      cin >> a[i];
      cnt[a[i]]++;
    }
    long long ma = 0;
    long long num = 0;
    for (long long i = 1; i <= n; i++) {
      ma = max(ma, cnt[a[i]]);
    }
    for (long long i = 0; i < maxm; i++) {
      if (cnt[i] == ma) {
        num++;
      }
    }
    long long ans = (n - ma * num) / (ma - 1) + num - 1;
    cout << ans << endl;
  }
  return 0;
}
