#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  scanf("%d", &n);
  vector<int> v(n + 1), cnt(n + 1, 0);
  int maxcnt = 0, cntfrq = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &v[i]);
    ++cnt[v[i]];
    maxcnt = max(maxcnt, cnt[v[i]]);
  }
  for (int i = 1; i <= n; ++i) {
    if (cnt[i] == maxcnt) ++cntfrq;
  }
  printf("%d\n", (n - cntfrq) / (maxcnt - 1) - 1);
}
int main() {
  int _ = 1;
  scanf("%d", &_);
  for (int i = 1; i <= _; ++i) solve();
}
