#include <bits/stdc++.h>
using namespace std;
long long t, n, a[100001], x, y, k, i, j;
int main() {
  cin >> t;
  for (j = 1; j <= t; j++) {
    cin >> n;
    x = 0;
    y = 0;
    for (i = 1; i <= n; i++) {
      cin >> k;
      a[k]++;
      if (a[k] > x) {
        x = a[k];
        y = 1;
      } else if (a[k] == x)
        y++;
    }
    k = (n - y + 1 - x) / (x - 1);
    if (x == 0)
      cout << n << endl;
    else if (k <= 0)
      cout << 0 << endl;
    else
      cout << k << endl;
    for (i = 1; i <= n; i++) a[i] = 0;
  }
  return 0;
}
