#include <bits/stdc++.h>
int t, n, a[100005], k, x, b;
int main() {
  scanf("%d", &t);
  while (t--) {
    x = 0;
    memset(a, 0, sizeof(a));
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &b);
      if (++a[b] > x)
        x = a[b], k = 1;
      else if (a[b] == x)
        k++;
    }
    printf("%d\n", (n - k) / (x - 1) - 1);
  }
  return 0;
}
