#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, ma = -1e18;
  cin >> n;
  long long a[n];
  map<long long, long long> m;
  for (long long int i = 0; i < n; i++) cin >> a[i], m[a[i]]++;
  for (auto i : m) ma = max(ma, i.second);
  long long v = 0;
  for (auto i : m)
    if (i.second == ma) v++;
  v--;
  cout << (n - ma - v) / (ma - 1) << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long test_cases = 1;
  cin >> test_cases;
  for (long long t = 1; t <= test_cases; t++) (solve());
  return 0;
}
