#include <bits/stdc++.h>
using namespace std;
int vals[100005];
int gouts[100005];
void prob() {
  int n;
  cin >> n;
  fill_n(vals, n, 0);
  for (int i = 0; i < n; i++) {
    int v;
    cin >> v;
    vals[v - 1]++;
  }
  int size = 0;
  for (int i = 0; i < n; i++) {
    if (vals[i] > 0) {
      gouts[size++] = vals[i];
    }
  }
  sort(gouts, gouts + size);
  int taille = gouts[size - 1] - 1;
  int total = 0;
  for (int i = size - 2; i >= 0; i--) {
    total += min(gouts[i], taille);
  }
  cout << (total / taille) << '\n';
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) prob();
  return 0;
}
