#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f;
const int maxn = 2e7;
const int mod = 1e9 + 7;
const int base = 26;
int a[maxn];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    memset(a, 0, sizeof(a));
    cin >> n;
    int mx = -1, sum = 1;
    for (int i = 0; i < n; i++) {
      int m;
      cin >> m;
      a[m]++;
      if (mx == a[m]) sum++;
      if (mx < a[m]) {
        mx = max(mx, a[m]);
        sum = 1;
      }
    }
    cout << (n - sum) / (mx - 1) - 1 << endl;
  }
  return 0;
}
