#include <bits/stdc++.h>
using namespace std;
const int N = 300000 + 3;
const int INF = int(1e18) + 100;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n, i, x, mx = -1;
    cin >> n;
    long long a[n], fr[100000 + 5] = {0}, ffr[100000 + 5] = {0};
    for (i = 0; i < n; i++) {
      cin >> a[i];
      fr[a[i]]++;
    }
    for (i = 0; i <= 100000; i++) {
      mx = max(fr[i], mx);
    }
    for (i = 0; i <= 100000; i++) {
      ffr[fr[i]]++;
    }
    x = n - ffr[mx];
    mx--;
    long long p = x / mx;
    p--;
    cout << p << endl;
  }
  return 0;
}
