#include <bits/stdc++.h>
using namespace std;
map<int, int> occ;
bool comp(int a, int b) { return occ[a] >= occ[b]; }
signed main() {
  ios_base::sync_with_stdio();
  cin.tie(0);
  cout.tie(0);
  ;
  int test;
  cin >> test;
  while (test--) {
    occ.clear();
    int n;
    cin >> n;
    int a[n];
    for (__typeof(n) i = 0; i < n; i++) {
      cin >> a[i];
      occ[a[i]]++;
    }
    int num, Max = 0, remain = 0;
    for (auto x : occ) {
      if (x.second > Max) {
        Max = x.second;
        num = 1;
      } else if (x.second == Max) {
        num++;
      }
    }
    for (auto x : occ) {
      if (x.second < Max) remain += x.second;
    }
    cout << num - 1 + remain / (Max - 1) << endl;
  }
  return 0;
}
