#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n;
    map<int, int> m;
    int maxi = 0;
    for (int f = 0; f < n; f++) {
      cin >> x;
      m[x]++;
      maxi = max(maxi, m[x]);
    }
    int a = 0;
    for (auto it = m.begin(); it != m.end(); it++) {
      if (it->second == maxi) {
        a++;
      }
    }
    cout << (n - a) / (maxi - 1) - 1 << endl;
  }
}
