#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int A[n];
    for (long long int i = 0; i < n; i += 1) {
      cin >> A[i];
    }
    vector<long long int> acc(n + 1);
    for (long long int i = 0; i < n; i += 1) {
      acc[A[i]]++;
    }
    long long int ans = std::numeric_limits<long long int>::min();
    for (long long int i = 1; i <= n; i += 1) {
      ans = max(ans, acc[i]);
    }
    long long int cnt = 0;
    for (long long int i = 1; i <= n; i += 1) {
      if (acc[i] == ans) cnt++;
    }
    cout << (n - (cnt - 1) - ans) / (ans - 1) << "\n";
  }
  return 0;
}
