Advertisement
Saleh127

CF 1393C

Aug 7th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. ios_base::sync_with_stdio(0);
  6. cin.tie(0);cout.tie(0);
  7. int tt;
  8. cin>>tt;
  9. while(tt--)
  10. {
  11. int a[100005]={0},c,d,e=0,f=0,i,j=0,k,l;
  12. cin>>c;
  13. for(i=0;i<c;i++)
  14. {
  15. cin>>d;
  16. f=max(f,d);
  17. a[d]++;
  18. e=max(e,a[d]);
  19. }
  20. for(i=1;i<=f;i++)
  21. {
  22. if(a[i]==e)
  23. {
  24. j++;
  25. }
  26. }
  27. l=(c-j)/(e-1);
  28. cout<<l-1<<endl;
  29. }
  30. return 0;
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement