#include <bits/stdc++.h>
using namespace std;
int a[100005];
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) a[i] = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[x]++;
  }
  int mx = 0, c = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] > mx) {
      mx = a[i];
      c = 1;
    } else if (a[i] == mx)
      c++;
  printf("%d\n", (n - mx * c) / (mx - 1) + c - 1);
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) solve();
  return 0;
}
