#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const long long MOD = 1e9 + 7;
using namespace std;
long long n_bits(long long n) {
  long long x = __builtin_popcount(n);
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    int n, mx = 0, cnt = 0;
    cin >> n;
    int a[n];
    map<int, int> make_pair;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      make_pair[a[i]]++;
      mx = max(make_pair[a[i]], mx);
    }
    for (int i = 0; i < n; i++) {
      cnt += (make_pair[a[i]] == mx);
    }
    int ans = (n - mx - (cnt / mx) + 1) / (mx - 1);
    cout << ans << "\n";
  }
  return 0;
}
