#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    map<int, int> mp;
    for (int i = 0; i < n; i++) {
      int k;
      cin >> k;
      if (mp.find(k) == mp.end())
        mp[k] = 1;
      else
        mp.find(k)->second++;
    }
    vector<int> v;
    for (auto i = mp.begin(); i != mp.end(); i++) v.push_back(i->second);
    int count = 1, m = v.size();
    sort(v.begin(), v.end());
    for (int j = m - 2; j >= 0; j--) {
      if (v[j] == v[j + 1])
        count++;
      else
        break;
    }
    n = n - count;
    int x = n / (v[m - 1] - 1);
    cout << x - 1 << endl;
  }
  return 0;
}
