#include <bits/stdc++.h>
using namespace std;
int t, n, num, a[100005];
int main() {
  ios::sync_with_stdio(0);
  cin >> t;
  while (t--) {
    memset(a, 0, sizeof(a));
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> num, a[num]++;
    sort(a + 1, a + 1 + n, greater<int>());
    int maxn = a[1], sum = 0, cnt = 0;
    for (int i = 2; i <= n; i++) {
      if (!a[i]) break;
      if (a[i] == maxn)
        sum++;
      else
        cnt += a[i];
    }
    sum = sum + cnt / (maxn - 1);
    cout << sum << endl;
  }
  return 0;
}
