#include <bits/stdc++.h>
using namespace std;
int a[100005];
void solve() {
  long long n, i, j, k, max, sum, max_c, ans;
  cin >> n;
  for (i = 1; i <= n; i++) {
    a[i] = 0;
  }
  max = 0;
  for (i = 1; i <= n; i++) {
    cin >> k;
    a[k]++;
    if (a[k] > max) {
      max = a[k];
    }
  }
  max_c = 0;
  for (i = 1; i <= n; i++) {
    if (a[i] == max) {
      max_c++;
    }
  }
  ans = (n - max - max_c + 1) / (max - 1);
  cout << ans << endl;
}
int main() {
  long long i, t;
  cin >> t;
  for (i = 0; i < t; i++) {
    solve();
  }
}
