#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int inf = 1e9 + 7;
const long long INF = 1e18 + 7;
int n, a[N];
void go() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  vector<int> v;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (i == 1 || a[i] == a[i - 1])
      cnt++;
    else {
      v.push_back(cnt);
      cnt = 1;
    }
  }
  v.push_back(cnt);
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  cnt = 0;
  for (int i = 1; i < (int)v.size(); i++) {
    if (v[i] == v[0]) v[i]--;
    cnt += v[i];
  }
  cout << cnt / (v[0] - 1) << endl;
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    go();
  }
}
