#include <bits/stdc++.h>
using namespace std;
int p[100005];
bool cmp(int a, int b) { return a > b; }
int main() {
  int t;
  cin >> t;
  while (t--) {
    memset(p, 0, sizeof(p));
    int n;
    cin >> n;
    int tot = 0;
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      if (p[x] == 0) tot++;
      p[x]++;
    }
    sort(p + 1, p + 100001, cmp);
    int mx = p[1];
    int remain = 0;
    int cnt = 0;
    for (int i = 1; i <= tot; i++) {
      if (p[i] == mx) remain++;
    }
    cnt = n - remain;
    cout << cnt / (mx - 1) - 1 << endl;
  }
}
