#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    map<int, int> mp;
    for (int i = 0; i < n; i++) mp[a[i]]++;
    int mmax = INT_MIN;
    for (auto e : mp) mmax = max(mmax, e.second);
    int cnt = 0;
    for (auto e : mp) cnt += (e.second == mmax);
    cout << (n - cnt - mmax + 1) / (mmax - 1) << endl;
  }
}
