Saleh127

Untitled

May 16th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define sc(a) scanf("%lld",&a)
  6. #define sc2(a,b) scanf("%lld %lld",&a,&b)
  7. #define pf(a) printf("%lld",a)
  8. #define loop1(i,a,c) for(i=a;i<=c;i++)
  9. #define loop(i,c) for(i=0;i<c;i++)
  10. int main()
  11. {
  12. ll a[200005],c,d,e,f,i,j,k,l;
  13. test
  14. {
  15. cin>>c;
  16. loop(i,c)
  17. {
  18. cin>>a[i];
  19. }
  20. sort(a,a+c);
  21. d=0,e=0;
  22. loop(i,c)
  23. {
  24. d++;
  25. if(d==a[i])
  26. {
  27. e++;
  28. d=0;
  29. }
  30. }
  31. cout<<e<<endl;
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment