#include <bits/stdc++.h>
using namespace std;
int a[100001];
void reset(int n) {
  for (int i = 0; i != n; i++) a[i + 1] = 0;
}
void solve() {
  int n, x, mx = 0, ct = 0;
  cin >> n;
  reset(n);
  for (int i = 0; i != n; i++) {
    cin >> x;
    a[x]++;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] > mx) {
      mx = a[i];
      ct = 1;
    } else if (a[i] == mx) {
      ct++;
    }
  }
  cout << (n - ct - mx + 1) / (mx - 1) << endl;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
}
