#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int a[n], cnt[n + 1];
  memset(cnt, 0, sizeof(cnt));
  int mx = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ++cnt[a[i]];
    mx = max(mx, cnt[a[i]]);
  }
  int mxf = 0;
  for (int i = 1; i <= n; i++) {
    mxf += (cnt[i] == mx);
  }
  cout << (n - mxf) / (mx - 1) - 1 << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
