#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int INF = 1e18;
const int N = 18;
void solve(int t) {
  long long int n;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  map<long long int, long long int> m;
  for (int i = 0; i < n; i++) m[a[i]]++;
  long long int ma = 0;
  long long int num = -1;
  for (auto i : m) {
    if (i.second >= ma) {
      ma = i.second;
      num = i.first;
    }
  }
  long long int sum = 0;
  for (auto i : m) {
    if (i.first != num) {
      sum += min(i.second, ma - 1);
    }
  }
  cout << sum / (ma - 1) << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve(i);
  }
}
